Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Dialog.GetButtonPressed

Queries index of selected button.

Component Version macOS Windows Linux Server iOS SDK
Dialog 7.2 ✅ Yes ✅ Yes ❌ No ❌ No ❌ No
MBS( "Dialog.GetButtonPressed" )

Parameters

none

Result

Returns number or error.

Description

Queries index of selected button.
Value is negative If not applicable.
Index is 0 for first button.

Examples

Run dialog with one Let statement:

Let (
[
        _ = MBS("Dialog.Reset") ;
        _ = MBS("Dialog.SetDefaultButton" ; "Yes") ;
        _ = MBS("Dialog.SetOtherButton" ; "No") ;
        _ = MBS("Dialog.SetAlternateButton" ; "Cancel") ;
        _ = MBS("Dialog.SetMessage" ; "Delete the old file?") ;
        _ = MBS("Dialog.SetWindowTitle" ; "Backups done") ;
        _ = MBS("Dialog.Run") ;
        button = MBS("Dialog.GetButtonPressed")
] ;
        // 0 -> Yes, 1 -> No, 2 -> Cancel
        button
)

See also

Release notes

Blog Entries

This function is free to use.

Created 6th April 2017, last changed 21st February 2026


Dialog.GetButton - Dialog.GetButtons


MarkDown version: DialogGetButtonPressed.md