Form.Selection
The Form.Selection property returns the text that is on the button that was used to close the Form.
Syntax |
Form.Selection |
Description |
Indicates which button was selected in order to close the Form. The Form.Selection property is read-only. |
Arguments |
None |
Returns |
String Returns the text that is shown on the button that was used to close the Form. If there is no text on the button, an empty string is returned. |
Example:
Msgbox Form.Selection
On a Form that has multiple buttons for closing, the selection property can be used to determine which of the buttons was pressed to close the window. For example, it can be used to determine whether the OK button or Cancel button was pressed (the property will return OK or Cancel respectively).