This works for me.
Dim mStrip As MenuStrip = ctl (ctl comes from the whole control collection
over
which I am iterating)
Dim mItem As ToolStripMenuItem
Dim mSubItem As ToolStripMenuItem
Dim i As Int16, j As Int16, k As Int16
For i = 0 To mStrip.Items.Count - 1
mItem = CType(mStrip.Items.Item(i), ToolStripMenuItem)
MsgBox(mItem.Text)
' now look for sub menu items
For j = 0 To mItem.DropDownItems.Count - 1
MsgBox(mItem.DropDownItems(j).Text)
' now look for sub sub menu items (thats as far as we go)
mSubItem = mItem.DropDownItems(j)
For k = 0 To mSubItem.DropDownItems.Count - 1
MsgBox(mSubItem.DropDownItems(k).Text)
Next k
Next j
Next i
--
stullhe104
"Brian" wrote:
Hi,
I have a menustrip that has 3 main menus and various number of menus below
them...
I am trying to figure out how i can loop through the main menus and then
loop through each one of the main menus to get their items and .text field.
Any help....
Brian