disable menuitem during run-time

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

Agnes

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
 
* "Agnes said:
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.
 
Hashtable ?? I need to create a datatable to store the name ??

Herfried K. Wagner said:
* "Agnes said:
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.
 
* "Agnes said:
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.
 

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

Back
Top