Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2007

Tip: Looking for answers? Try searching our database.

How to disable menu item and its sub menu items?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew - 10 Aug 2007 20:06 GMT
Hi, friends,

I am using C#.net 2005 to create a windows application.

It has menu items, such as File, etc.
Under File, there are more menu items, such as New Files, Working Files, etc.
Under New Files/Working Files, there are more sub menu items, respectively.

All those menu items are enabled at beginning.

It requires that:
          If a user clicks on a sub menu of New Files, New Files menu and
all its sub menu items will be disabled;
          If a user clicks on a sub menu of Working Files, Working Files
menu and all its sub menu items will be disabled.

In my source code, once a user clicks on a sub menu of New Files, I set
      newFilesStripMenuItem.Enabled = false;
hoping that it will disable New Files menu and all its sub menu items
without writting 10 more lines to disable each its sub menu items one by one.

To my surprise, when I moved mouse pointer from Working Files menu (which
was still enabled and automatically displayed all its sub menu items while
moving mouse pointer) to New Files menu, all sub menu items of New Files menu
was displayed!

I was expecting all those sub menu items should NOT be displayed since New
Files menu was DISABLED. (Indeed, if I put mouse pointer on New Files menu
first without moving from Working Files menu, or if I clicked on New Files
menu directly, all those sub menu items could NOT be displayed)

Any ideas? Thanks a lot.
PitG - 11 Aug 2007 20:56 GMT
Hi Andrew,

you are near the target. Try Visible instead of Enable. Enable only disables
the event sending ...

regards
Signature

PG

> Hi, friends,
>
[quoted text clipped - 28 lines]
>
> Any ideas? Thanks a lot.
Andrew - 13 Aug 2007 16:46 GMT
Hi, PG,

Thanks for the reply, but we still want that menu item to be seen by users,
although it is disabled...

Any other idea?

Andrew

> Hi Andrew,
>
[quoted text clipped - 35 lines]
> >
> > Any ideas? Thanks a lot.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.