How can I get the Menuitem 's name ??

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
 
H

Herfried K. Wagner [MVP]

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').
 
A

Agnes

Thanks Herfried,
I try to modify the Hash Table, But fail........Anyway , thanks a lot
 
A

Agnes

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
 
A

Agnes

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"
 
M

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top