Enabled Menu Item

How do I disable and enable a menu? I have a menu named mnuFileSave. I use the code below in the App open event

mnuFileSave.enabled=False

and I get “This item does not exist” error even though it autocomleted.

Did you read about Menus in the manual?

Yes, that is where I found the code I used.

Did you notice the references to the EnabledMenuItems event? The Open event is the wrong place.

I did this my app in App Open Event.
MenuItem.AutoEnable=False
or True
Is it OK?

In Xojo 2014r2.1 on Windows 7, in a Desktop project, in main Window1, select the “Event Handlers”, and from menu choose “Insert - Event Handlers…”. In the displayed dialogue box “Add Event Handler to” choose “EnableMenuItems”. Click on the “EnableMenuItems” event handler and add the following code.

mnuFileSave.Enabled = True

The menu item “File - Save” should now get displayed as enabled.

Paul posted in another thread:

[quote=127312:@Paul Lefebvre]You are over-thinking it. In this situation, just take advantage of the Auto-Enable property of the “Save” menu item (which should be ON by default). When ON, it will automatically enable the Save menu when you add code to the Save menu handler.

So windows that implement the Save menu handler will have the Save menu enabled and windows that do not implement the Save menu handler will not have it enabled.[/quote]