Deutsches LiveCode Wiki
Advertisement

Reports the long ID of the current card's default button.Syntax:

get the defaultButton of <card>

Examples:

send mouseUp to the defaultButton of this card

Use the defaultButton property to find out which button on a card is designated as the button to be clicked when the user presses the Return or Enter key.

The defaultButton property returns the long ID of the button whose default property is set to true.

When the user presses Enter or Return and there is no active control, LiveCode sends a mouseUp message to the defaultButton. (If the card contains an editable field, handle the returnInField and enterInField messages to ensure that the default button is activated.)

If more than one button's default is true, the defaultButton property reports the ID of the button whose default property was set to true most recently. This property reports empty if there is no default button.

See also: returnInField (message),enterInField (message),default (property),ID (property),

Advertisement