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


represents a Cancel button in a dialog that closes the dialog window when pressed.
represents a button labeled Cancel that evaluates action when pressed.
CancelButton[label, action]
uses label as the label for the button.
  • In dialogs created with DialogInput or CreateDialog, pressing Esc is effectively equivalent to pressing the Cancel button.
  • If there are several Cancel buttons in a single dialog, Esc will use the first one in the dialog.
New in 6