Enabling and Disabling items

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
Hi all,

Am attempting to write a simple windows booking application, that allows me to add and modify, rooms, clients, staff, and bookings. I have a log in form that the user must use to gain access to the program, they are then moved to mainForm, which has a menu with a number of options that redirect you to the correct form. I want to disable the menu item that was selected prior to a form being displayed, and then want to reenable it when the particular form is closed. However I am unsure/unable to call a method in the mainForm that would do the enabling. Any suggestions.

Mike55
 
1) Use the menu options click event to disable the item once the new form has been opened/displayed

2) In the new form, raise an event that your main form will handle that can then re-enable the menu option when your new form is closing
 
In your main form you can store a reference to the opened form and handle its closed event and in the handler re-enable the menu item.

Also, just a recommendation: Instead of disabling the menu items, when the user clicks a menu item that should open a form that is already open, why not just focus that form. That is what I usually do.
 
Back
Top