Fired when a user executes a command by clicking a button.
Parameters
Parameter | Description |
---|---|
Command | The key of the command that was executed |
Remarks
The OnCommand event is fired when the user clicks on a button. Buttons are always associated with a command, which allows the same command to be used for multiple buttons. Event handling is simplified as a result. You can use this command to respond to a particular command, such as the "SAVE" command, and it won't matter how the command was executed. All your code can be in one convenient place.
The Command parameter contains the key of the command that was executed.
Example
Begin Case Case Event EQ "OnCommand" Command = Param1 Begin Case Case Command EQ "CLOSE" ; GoSub DoClose Case Command EQ "OPEN" ; GoSub DoOpen Case Command EQ "SAVE" ; GoSub DoSave End Case End Case