DefaultButton
represents an OK button that closes a dialog, and is the default when is pressed in the dialog.
DefaultButton[action]
represents a button that is labeled OK, and whose action is to evaluate action.
DefaultButton[label,action]
uses label as the label for the button.
Details and Options

- DefaultButton[] is equivalent to DefaultButton[DialogReturn[]].
- In dialogs created with DialogInput or CreateDialog, pressing
is effectively equivalent to clicking the OK button.
- If there are several default buttons in a single dialog,
will use the first one in the dialog.
- DefaultButton has the same options as Button.
-
Alignment Automatic how to align contents within the button Appearance Automatic the overall appearance of the button AutoAction False whether to click the button automatically when the mouse is over it Background Automatic button background color BaselinePosition Automatic alignment relative to surrounding text BaseStyle "GenericButton" base style specifications for the button ContentPadding True whether to shrink the margins tightly around the contents Enabled Automatic whether the button is enabled or grayed out Evaluator Automatic the kernel in which to evaluate expr FrameMargins Automatic minimum margins to leave inside the frame ImageMargins 0 margins around the image of the displayed button ImageSize Full the overall image size of the displayed button Method "Preemptive" the evaluation method to use Tooltip None the tooltip for the button TooltipDelay 0.` how long to delay before displaying the tooltip TooltipStyle {} style specifications for the tooltip
List of all options

Examples
open allclose allBasic Examples (1)
Create dialog input, and use DefaultButton to dismiss dialog:
Applications (1)
Create a dialog with a Locator, and return the last location:
Properties & Relations (3)
DefaultButton is a special case of Button:
Create a dialog with an OK button; the window is dismissed with a click or :
Create a dialog that holds evaluations until the dialog is dismissed:
Text
Wolfram Research (2007), DefaultButton, Wolfram Language function, https://reference.wolfram.com/language/ref/DefaultButton.html.
CMS
Wolfram Language. 2007. "DefaultButton." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DefaultButton.html.
APA
Wolfram Language. (2007). DefaultButton. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DefaultButton.html