By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

disable menuitem during run-time

P: n/a
How can I do that , I want to write a method with the parameter (the
meunitem's name) [MuST be name]
As I pass the parameter, the Menu's meunitem will be disable.

Thanks
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
* "Agnes" <ag***@dynamictech.com.hk> scripsit:
How can I do that , I want to write a method with the parameter (the
meunitem's name) [MuST be name]


Menu items don't have a name. All you can do is storing (name,
'MenuItem') pairs in a 'Hashtable' and use the hashtable to loopup a
menu item by its name.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2

P: n/a
Hashtable ?? I need to create a datatable to store the name ??

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> ???
news:2p************@uni-berlin.de ???...
* "Agnes" <ag***@dynamictech.com.hk> scripsit:
How can I do that , I want to write a method with the parameter (the
meunitem's name) [MuST be name]


Menu items don't have a name. All you can do is storing (name,
'MenuItem') pairs in a 'Hashtable' and use the hashtable to loopup a
menu item by its name.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

P: n/a
Agnes,

A hastable is a collection class that holds a key and one item per row,
therefore you can use it the same as a datatable and a dataview, however for
this purpose the hashtable is more the one to take.

http://support.microsoft.com/default...b;en-us;307933

I hope this helps

Cor
Nov 21 '05 #4

P: n/a
* "Agnes" <ag***@dynamictech.com.hk> scripsit:
Hashtable ?? I need to create a datatable to store the name ??


'System.Collections.Hashtable' can be used to store (key, value) pairs.
So that's an appropriate way to access menu items by their name by
using the name as key and the reference to the menu item as value.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.