|
|
|
start date: Fri, 10 Aug 2007 12:06:01 -0700,
posted on: microsoft.public.dotnet.framework
back
| Thread Index |
|
1
Andrew
|
|
2
PitG
|
|
3
Andrew
|
How to disable menu item and its sub menu items?
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.
Date:Fri, 10 Aug 2007 12:06:01 -0700
Author:
|
RE: How to disable menu item and its sub menu items?
Hi Andrew,
you are near the target. Try Visible instead of Enable. Enable only disables
the event sending ...
regards
--
PG
"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 NOT be displayed)
>
> Any ideas? Thanks a lot.
>
>
>
Date:Sat, 11 Aug 2007 12:56:00 -0700
Author:
|
RE: How to disable menu item and its sub menu items?
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
"PitG" wrote:
> Hi Andrew,
>
> you are near the target. Try Visible instead of Enable. Enable only disables
> the event sending ...
>
> regards
> --
> PG
>
>
> "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 NOT be displayed)
> >
> > Any ideas? Thanks a lot.
> >
> >
> >
Date:Mon, 13 Aug 2007 08:46:01 -0700
Author:
|
|
|