PC Review


Reply
Thread Tools Rate Thread

How to disable a menu item and all its sub menu items?

 
 
=?Utf-8?B?QW5kcmV3?=
Guest
Posts: n/a
 
      10th Aug 2007
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 be NOT displayed)

Any ideas? Thanks a lot.




 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW5kcmV3?=
Guest
Posts: n/a
 
      10th Aug 2007
(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 be NOT displayed)

should be:

(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)


"Andrew" wrote:

> 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 be NOT displayed)
>
> Any ideas? Thanks a lot.
>
>
>
>

 
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
Re: Temporary Form with 2 Sub form Update Main Form And its Sub form ? Jeanette Cunningham Microsoft Access Form Coding 0 25th Nov 2009 03:27 AM
How to disable a menu item had its sub memu items? =?Utf-8?B?QW5kcmV3?= Microsoft Dot NET 1 16th Aug 2007 08:33 PM
How to disable menu item and its sub menu items? =?Utf-8?B?QW5kcmV3?= Microsoft Dot NET Framework 2 13th Aug 2007 04:46 PM
Arrggghhhh!!!!!!!! to all .~ and all its irks and all its dismays Zoe Microsoft Outlook Installation 2 13th Apr 2004 08:09 AM
wfwnet.drv file error its like its missing but its not pirate 12384 Windows XP Performance 0 22nd Dec 2003 11:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:28 AM.