Method dialog.Buttons
Overload
Sets buttons.
public dialog Buttons(Strings buttons = default, bool asCommandLinks = false)
Parameters
|
buttons (Strings)
List of button names or |
|
asCommandLinks (bool)
The style of custom buttons. If |
Returns
Remarks
If buttons not set, the dialog will have OK button, id 1.
Missing ids are auto-generated, for example "OK|Cancel|100 Custom1|Custom2" is the same as "1 OK|2 Cancel|100 Custom1|101 Custom2".
The first in the list button is the default button, ie is focused and therefore responds to the Enter key. For example, "2 No|1 Yes" adds Yes and No buttons and makes No default.
To create keyboard shortcuts, use & character in custom button labels. Use && for literal &. Example: "1 &Tuesday[]2 T&hursday[]3 Saturday && Sunday".
Trims newlines around ids and labels. For example, "\r\n1 One\r\n|\r\n2\r\nTwo\r\n\r\n" is the same as "1 One|2 Two".
There are 6 common buttons: OK, Yes, No, Retry, Cancel, Close. Buttons that have other names are custom buttons. How common buttons are different:
- The button style is not affected by asCommandLinks or DFlags.CommandLinks.
- They have keyboard shortcuts that cannot be changed. Inserting
&in a label makes it a custom button. - Button Cancel can be selected with the
Esckey. It also adds X (Close) button in title bar, which selects Cancel. - Always displayed in standard order (eg Yes No, never No Yes). But you can for example use
"2 No|1 Yes"to set default button = No. - The displayed button label is localized, ie different when the Windows UI language is not English.