Home All Groups Group Topic Archive Search About

How can I get the Menuitem 's name ??

Author
27 Mar 2005 4:02 PM
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

Author
27 Mar 2005 4:35 PM
Herfried K. Wagner [MVP]
"Agnes" <ag***@dynamictech.com.hk> schrieb:
>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').

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
28 Mar 2005 3:27 AM
Agnes
Thanks Herfried,
I try to modify the Hash Table, But fail........Anyway , thanks a lot
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at>
???????:%23eykwquMFHA.2***@TK2MSFTNGP12.phx.gbl...
Show quoteHide quote
> "Agnes" <ag***@dynamictech.com.hk> schrieb:
>>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').
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>
Author
28 Mar 2005 4:23 AM
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
Show quoteHide quote
"Agnes" <ag***@dynamictech.com.hk> ¼¶¼g©ó¶l¥ó·s»D:%233lPQY0MFHA.1***@TK2MSFTNGP10.phx.gbl...
> Thanks Herfried,
> I try to modify the Hash Table, But fail........Anyway , thanks a lot
> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at>
> ???????:%23eykwquMFHA.2***@TK2MSFTNGP12.phx.gbl...
>> "Agnes" <ag***@dynamictech.com.hk> schrieb:
>>>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').
>>
>> --
>> M S   Herfried K. Wagner
>> M V P  <URL:http://dotnet.mvps.org/>
>> V B   <URL:http://classicvb.org/petition/>
>
>
Author
28 Mar 2005 12:49 PM
Mick Doherty
There's a MenuExtender example on my site that adds a Tag  and RadioGroup
property to menuitems.
You will find source in both VB and C#
http://dotnetrix.co.uk/menus.html

Show quoteHide quote
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%23Yvqc30MFHA.436@TK2MSFTNGP09.phx.gbl...
> 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" <ag***@dynamictech.com.hk>
> ¼¶¼g©ó¶l¥ó·s»D:%233lPQY0MFHA.1***@TK2MSFTNGP10.phx.gbl...
>> Thanks Herfried,
>> I try to modify the Hash Table, But fail........Anyway , thanks a lot
>> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at>
>> ???????:%23eykwquMFHA.2***@TK2MSFTNGP12.phx.gbl...
>>> "Agnes" <ag***@dynamictech.com.hk> schrieb:
>>>>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').
>>>
>>> --
>>> M S   Herfried K. Wagner
>>> M V P  <URL:http://dotnet.mvps.org/>
>>> V B   <URL:http://classicvb.org/petition/>
>>
>>
>
>
Author
29 Mar 2005 2:27 AM
Agnes
I just try your code, It seems sucesfully.
Thanks In Advance.

"Mick Doherty"
<EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> ¼¶¼g©ó¶l¥ó·s»D:OXQJfS5MFHA.3***@TK2MSFTNGP15.phx.gbl...
Show quoteHide quote
> There's a MenuExtender example on my site that adds a Tag  and RadioGroup
> property to menuitems.
> You will find source in both VB and C#
> http://dotnetrix.co.uk/menus.html
>
> --
> Mick Doherty
> http://dotnetrix.co.uk/nothing.html
>
>
> "Agnes" <ag***@dynamictech.com.hk> wrote in message
> news:%23Yvqc30MFHA.436@TK2MSFTNGP09.phx.gbl...
>> 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" <ag***@dynamictech.com.hk> ¼¶¼g©ó¶l¥ó·s»D:%233lPQY0MFHA.1***@TK2MSFTNGP10.phx.gbl...
>>> Thanks Herfried,
>>> I try to modify the Hash Table, But fail........Anyway , thanks a lot
>>> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at>
>>> ???????:%23eykwquMFHA.2***@TK2MSFTNGP12.phx.gbl...
>>>> "Agnes" <ag***@dynamictech.com.hk> schrieb:
>>>>>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').
>>>>
>>>> --
>>>> M S   Herfried K. Wagner
>>>> M V P  <URL:http://dotnet.mvps.org/>
>>>> V B   <URL:http://classicvb.org/petition/>
>>>
>>>
>>
>>
>
>
Author
29 Mar 2005 3:14 AM
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"
<EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> ¼¶¼g©ó¶l¥ó·s»D:OXQJfS5MFHA.3***@TK2MSFTNGP15.phx.gbl...
Show quoteHide quote
> There's a MenuExtender example on my site that adds a Tag  and RadioGroup
> property to menuitems.
> You will find source in both VB and C#
> http://dotnetrix.co.uk/menus.html
>
> --
> Mick Doherty
> http://dotnetrix.co.uk/nothing.html
>
>
> "Agnes" <ag***@dynamictech.com.hk> wrote in message
> news:%23Yvqc30MFHA.436@TK2MSFTNGP09.phx.gbl...
>> 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" <ag***@dynamictech.com.hk> ¼¶¼g©ó¶l¥ó·s»D:%233lPQY0MFHA.1***@TK2MSFTNGP10.phx.gbl...
>>> Thanks Herfried,
>>> I try to modify the Hash Table, But fail........Anyway , thanks a lot
>>> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at>
>>> ???????:%23eykwquMFHA.2***@TK2MSFTNGP12.phx.gbl...
>>>> "Agnes" <ag***@dynamictech.com.hk> schrieb:
>>>>>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').
>>>>
>>>> --
>>>> M S   Herfried K. Wagner
>>>> M V P  <URL:http://dotnet.mvps.org/>
>>>> V B   <URL:http://classicvb.org/petition/>
>>>
>>>
>>
>>
>
>
Author
29 Mar 2005 8:09 AM
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

Show quoteHide quote
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:Of4gB2ANFHA.1732@TK2MSFTNGP14.phx.gbl...
> 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"
> <EXCHANGE#WITH@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]>
> ¼¶¼g©ó¶l¥ó·s»D:OXQJfS5MFHA.3***@TK2MSFTNGP15.phx.gbl...
>> There's a MenuExtender example on my site that adds a Tag  and RadioGroup
>> property to menuitems.
>> You will find source in both VB and C#
>> http://dotnetrix.co.uk/menus.html
>>
>> --
>> Mick Doherty
>> http://dotnetrix.co.uk/nothing.html
>>
>>
>> "Agnes" <ag***@dynamictech.com.hk> wrote in message
>> news:%23Yvqc30MFHA.436@TK2MSFTNGP09.phx.gbl...
>>> 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" <ag***@dynamictech.com.hk>
>>> ¼¶¼g©ó¶l¥ó·s»D:%233lPQY0MFHA.1***@TK2MSFTNGP10.phx.gbl...
>>>> Thanks Herfried,
>>>> I try to modify the Hash Table, But fail........Anyway , thanks a lot
>>>> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at>
>>>> ???????:%23eykwquMFHA.2***@TK2MSFTNGP12.phx.gbl...
>>>>> "Agnes" <ag***@dynamictech.com.hk> schrieb:
>>>>>>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').
>>>>>
>>>>> --
>>>>> M S   Herfried K. Wagner
>>>>> M V P  <URL:http://dotnet.mvps.org/>
>>>>> V B   <URL:http://classicvb.org/petition/>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Author
30 Mar 2005 11:21 PM
Gary Lam
There is a programme called reflector. which can convert any DLL to either C# or VB

Now you can view the methods with different languages ^_^

http://www.aisto.com/roeder/dotnet/ From http://www.developmentnow.com/g/38_2005_3_0_0_371002/How-can-I-get-the-Menuitem-s-name-.htm Posted via DevelopmentNow.com Groups http://www.developmentnow.com