This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

CancelButton

CancelButton
represents a Cancel button in a dialog that closes the dialog window when clicked.
CancelButton[action]
represents a button labeled Cancel that evaluates action when clicked.
CancelButton
uses label as the label for the button.
  • In dialogs created with DialogInput or CreateDialog, pressing Esc is effectively equivalent to clicking the Cancel button.
  • If there are several Cancel buttons in a single dialog, Esc will use the first one in the dialog.
Create dialog input and use CancelButton to cancel the action:
Create dialog input and use CancelButton to cancel the action:
In[1]:=
Click for copyable input
Out[1]=
Create a dialog with both a default button and a cancel button:
Create a dialog with a close button:
CancelButton is a special case of Button:
Create a dialog with a cancel button; the dialog is dismissed by clicking the button or pressing Esc:
Create a dialog that holds evaluations until the dialog is dismissed:
New in 6