Re: Loop through menu items in a toolbar
- From: mabond <mabond@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 18 Dec 2007 08:03:01 -0800
Thanks Smokey
appreciate the help
Regards
Michael Bond
"Smokey Grindel" wrote:
You are going to have to use recursion.
something like (this is pseudo code)
Private sub DigIntoMenu(byref currentItemOn as ToolStripMenuItem)
for each item as ToolStripMenuItem in currentItemOn.Items
' do something
' Recurse
DigIntoMenu(item.Items)
next
end sub
"mabond" <mabond@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E8DB5A0B-6336-4187-8A5C-EF7BA54B52C1@xxxxxxxxxxxxxxxx
Hi
I want to loop through the menu items (including sub menus) of a toolbar.
I'm using this at present
Dim mnu As ToolStripMenuItem
For Each mnu In Me.MenuStrip1.Items
'do something to menu item
Next
But it only gives me the top level menu items and not the ones that branch
off those
Can anyone suggest the better way to do this
Michael Bond
- References:
- Re: Loop through menu items in a toolbar
- From: Smokey Grindel
- Re: Loop through menu items in a toolbar
- Prev by Date: Re: OO development question...
- Next by Date: Re: System.InvalidCastException: QueryInterface for interface ... erro
- Previous by thread: Re: Loop through menu items in a toolbar
- Next by thread: Class Scoping Confusion
- Index(es):
Relevant Pages
|