Difference between revisions of "MenuItem.AutoEnabled"

From Xojo Documentation

(Notes)
 
Line 12: Line 12:
  
 
==Notes==
 
==Notes==
There is no need to put code in the [[MenuItem.MenuSelected|MenuSelected]] event handler to explicitly enable an autoenabled menu item. AutoEnabled is [[True]] by default. When you create dynamic menus by creating a new class based on '''MenuItem''', AutoEnabled is also [[True]] by default. See the example on dynamic menus on the [[MenuItem]] page.
+
There is no need to put code in the [[MenuItem.EnableMenu|EnableMenu]] event handler to explicitly enable an autoenabled menu item. AutoEnabled is [[True]] by default. When you create dynamic menus by creating a new class based on '''MenuItem''', AutoEnabled is also [[True]] by default. See the example on dynamic menus on the [[MenuItem]] page.
  
 
[[Category:API 2.0]]
 
[[Category:API 2.0]]

Latest revision as of 14:06, 12 November 2019

Property (As Boolean )
aMenuItem.AutoEnabled = newBooleanValue
or
BooleanValue = aMenuItem.AutoEnabled

New in 2019r2

Supported for all project types and targets.

If set to True, the MenuItem is enabled by default, as long as the App object or frontmost window has a menu handler for the menuitem.

Notes

There is no need to put code in the EnableMenu event handler to explicitly enable an autoenabled menu item. AutoEnabled is True by default. When you create dynamic menus by creating a new class based on MenuItem, AutoEnabled is also True by default. See the example on dynamic menus on the MenuItem page.