Examples › Conditionally disabling items
You can conditionally disable a menu item by setting its disabled property to true:
Right-click on the image to trigger the context menu:

Picture by Lloyd Henneman
Head over to the next example to learn how you could conditionally hide a menu item instead of disabling it.