You can enable or disable a menu or menu item based on a logical condition.
To enable or disable a menu or menu item
-
In the Prompt column, select the appropriate menu title or menu item.
-
Choose the button in the Options column to display the Prompt Options dialog box.
-
Select Skip For.
The Expression Builder appears.
-
In the Skip For box, type the expression that determines whether the menu or menu item is enabled or disabled.
If the expression evaluates to false (.F.), the menu or menu item is enabled. If the expression evaluates to true (.T.), the menu or menu item is disabled and cannot be selected or chosen. For details, see DEFINE BAR and DEFINE PAD.
Note: After the menu system has been displayed, you can enable and disable menus and menu items by using the SET SKIP OF Command.
On a menu, a check mark next to a menu item indicates that it is in effect. For example, if you put a check mark next to the Credit item on the Customer menu created earlier, Credit is in effect.
To mark the state of a menu item
-
At run time, place a check mark next to a menu item by using the SET MARK OF Command.
For an example of disabling and marking the state of menu items, run Solution.app in the Visual FoxPro ...\Samples\Solution directory.