SSpread.ButtonClicked Event
Occurs when a button is clicked in a command button type and check box type cell.
The following child objects are attached to the Event object.
| Type | Name | Description |
|---|---|---|
| Number | Col | Column number of the cell where the button was clicked |
| Number | Row | Row number of the cell where the button was clicked |
| Number | ButtonDown | Retained button (TypeButtonType property is $TypeButtonTypeTwoState) or checkbox state Retained button: $TRUE if pressed, $FALSE otherwise Buttons that are not retained buttons: Always $FALSE Checkbox: $TRUE if checked (or grayed out), $FALSE otherwise |
The event also occurs when you set the state of a retained button or check box from a CRS script using the Type, Value properties, and so on.
Example of usage
Function OnButtonClicked (e) {
Col = e.Col;
Row = e.Row;
if (CellType == $ CellTypeButton && TypeButtonType! = $ TypeButtonTypeTwoState) {
MessageBox (strf ("(% 1,% 2) was pressed ", e.Col, e.Row));
} else {
if (e.ButtonDown == $ TRUE) {
MessageBox (strf ("(% 1,% 2) checked ", e.Col, e.Row));
} else {
MessageBox (strf ("(% 1,% 2) unchecked ", e.Col, e.Row));
}
}
}
Related Item
CellType, Text, TypeButtonType, Value property