How can I get the Menuitem 's name ??

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

I know how to get the Menuitem's TEXT . BUT I need to get the names , Does
anyone know how to do ??
Thanks

I try That " For Each FileMenuItem As MenuItem In Me.Menu.menuitem" before
 
Agnes said:
I know how to get the Menuitem's TEXT . BUT I need to get the names , Does
anyone know how to do ??
Thanks

I try That " For Each FileMenuItem As MenuItem In Me.Menu.menuitem"
before

'MenuItem' doesn't have a 'Name' property. You may want to use an extender
component which provides the 'Name' property:

MenuItem Extender - add images and font support to your menu
<URL:http://www.codeproject.com/cs/menu/MenuExtender.asp>

If you want to lookup menu items, you can store (key, 'MenuItem') pairs in a
hash table ('Hashtable').
 
Dear Herfried,
Does there is anyway to convert c# into vb.net ?? I try to modify the
code, but really fail to understand the c#
Thanks
Agnes said:
Thanks Herfried,
I try to modify the Hash Table, But fail........Anyway , thanks a lot
 
Dear Mick
Thanks for your coding, I can add it to my mainmnenu. However, I don't
know how to retreive the property (Tag)
For Each FileMenuItem As MenuItem In Me.Menu.MenuItems
FileMenuItem.Tag <-- there is still no such property ????
next
"Mick Doherty"
 
You access the tag property in the same way as you access a ToolTip
property:

For Each FileMenuItem As MenuItem In Me.Menu.MenuItems
If Not MenuExtender1.GetTag(FileMenuItem) Is Nothing Then
MessageBox.Show(MenuExtender1.GetTag(FileMenuItem).ToString)
End If
Next
 
Back
Top