In my C# Windows application I have some menus attached like this
As you can see I have 4 menus disabled by default. Now what I want is enable / disable them on run time. So when the user selects login from User Section it should enable those menus after successful login and similarly disabled on logout. So what is the procedure to enable / disable some section of menus at run time?
Instead of handling the Click event, consider handling the MenuActivate event.
The reason is the Click event only works for the mouse (and what if the user is using a keyboard to invoke the menu?). The MenuActivate event works for both keyboard and mouse.
In my C# Windows application I have some menus attached like this
As you can see I have 4 menus disabled by default. Now what I want is enable / disable them on run time. So when the user selects login from User Section it should enable those menus after successful login and similarly disabled on logout. So what is the procedure to enable / disable some section of menus at run time?
Thanks in Advance
I would hide menue points that are not used in a given form. When some changes occur and the other menueheaders are needed, then I would make them visible. Different buttons in a menue I would disable. This creates a menue which seems to change depending on the users needs and gives it a professional touch
Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ? My latest articles : Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.