tora111
asked on
How to loop through each element ToolStrip includes all menuitems
I can get each item on the ToolStrip by the following codes.
Dim tObj As ToolStripItem
For Each tObj In ToolStrip.Items
debug.pring tObj.name
Next
However it didn't include the menu item inside the "ToolStripSplitButton" or "ToolStripDropDownButton"
So how to loop through each element includes all menuitem ?
Dim tObj As ToolStripItem
For Each tObj In ToolStrip.Items
debug.pring tObj.name
Next
However it didn't include the menu item inside the "ToolStripSplitButton" or "ToolStripDropDownButton"
So how to loop through each element includes all menuitem ?
ASKER
Desp,
Your code still cannot show the menuitem within the "ToolStripDropDownButton" !!!
Your code still cannot show the menuitem within the "ToolStripDropDownButton" !!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If TypeOf (obj) Is ToolStripButton Then
MessageBox.Show("ToolStrip
CType(obj, ToolStripButton).Visible = False 'chnage/use whatever property you like
ElseIf TypeOf (obj) Is ToolStripDropDownButton Then
MessageBox.Show("ToolStrip
CType(obj, ToolStripDropDownButton).V
End If
Next