PC Review


Reply
Thread Tools Rate Thread

disable menuitem during run-time

 
 
Agnes
Guest
Posts: n/a
 
      24th Aug 2004
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


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      24th Aug 2004
* "Agnes" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
Agnes
Guest
Posts: n/a
 
      25th Aug 2004
Hashtable ?? I need to create a datatable to store the name ??

"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> ???
news:(E-Mail Removed) ???...
> * "Agnes" <(E-Mail Removed)> 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/>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      25th Aug 2004
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


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      25th Aug 2004
* "Agnes" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Menuitem on Parent form a child =?Utf-8?B?TWljaGFlbA==?= Microsoft VB .NET 1 23rd Jun 2005 11:04 PM
Adding to an existing MenuItem's MenuItem Collection Dynamically snesbit Microsoft Dot NET Framework Forms 3 9th Mar 2005 03:08 AM
Adding to an existing MenuItem's MenuItem Collection Dynamically snesbit Microsoft VB .NET 1 9th Mar 2005 03:05 AM
How to disable menuitem for textbox control built-in contextmenu. =?Utf-8?B?UnVsaW4gSG9uZw==?= Microsoft VB .NET 1 6th Aug 2004 03:35 PM
Disable MenuItem Shortcut Marcel Microsoft C# .NET 0 16th Jul 2004 04:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:46 AM.