-1

I would like to iterate over all items in a ContextMenuStrip.

Can somebody please help me out here?

I was trying this, but it didn't work out:

For Each it As ToolStripItem In Me.ContextMenuStrip1.Items

Thank you!

tmighty
  • 10,734
  • 21
  • 104
  • 218

1 Answers1

1

The error is pretty clear to me =). Add the word Next where your loop ends.

For Each it As ToolStripItem In Me.ContextMenuStrip1.Items
    'Loop Contents
Next
Kevin DiTraglia
  • 25,746
  • 19
  • 92
  • 138