Onetastic Macro Documentation >
Adds a custom button to a dialog box..
- DialogBox dialogBox
- The dialogBox to add the button to.
- String label
- A label for the button. If there is an ampersand (&) sign before a character in the label it becomes the button's accelerator key.
- String name
- Name of the button. When a dialog box is closed by clicking on this button, DialogBox_Show function will return the name of the button that was clicked..
If no custom buttons are added to a dialog box, it will automatically have an "OK" button
when it is displayed. Up to 4 buttons can be added to a dialog box. When the user clicks
on a button the dialog box closes and DialogBox_Show function will return the name of
the button that was clicked
$dialog = DialogBox_Create("Do you want to delete this page?")
DialogBox_AddButton($dialog, "&Yes", "yes")
DialogBox_AddButton($dialog, "&No", "no")
If ("yes" == DialogBox_Show($dialog))
This will display the following dialog box:
After user clicks on one of the "Yes" and "No" buttons, DialogBox_Show function
returns either "yes" or "no", the name of the button user clicked.