ChoiceDialog[expr]
puts up a standard choice dialog that displays expr together with OK and Cancel buttons, and returns True if OK is clicked and False if Cancel is clicked.
ChoiceDialog[expr,{lbl1val1,lbl2val2,…}]
includes buttons with labels lbli, and returns the corresponding vali for the button clicked.
 
     
   ChoiceDialog
ChoiceDialog[expr]
puts up a standard choice dialog that displays expr together with OK and Cancel buttons, and returns True if OK is clicked and False if Cancel is clicked.
ChoiceDialog[expr,{lbl1val1,lbl2val2,…}]
includes buttons with labels lbli, and returns the corresponding vali for the button clicked.
Details and Options
 
   - ChoiceDialog places buttons automatically, outside the area used to display expr.
- Any expressions, including both text and graphics, can be used for expr and the lbli.
- In the window generated by ChoiceDialog[expr], pressing ![TemplateBox[{return}, Key0, BaseStyle -> {Notes, FontWeight -> Plain, FontFamily -> Source Sans Pro}] TemplateBox[{return}, Key0, BaseStyle -> {Notes, FontWeight -> Plain, FontFamily -> Source Sans Pro}]](Files/ChoiceDialog.en/1.png) is taken to be equivalent to clicking the OK button, while pressing is taken to be equivalent to clicking the OK button, while pressing or closing the window is taken to be equivalent to clicking the Cancel button. or closing the window is taken to be equivalent to clicking the Cancel button.
- In ChoiceDialog[expr,{lbl1->val1,…}], pressing ![TemplateBox[{return}, Key0, BaseStyle -> {Notes, FontWeight -> Plain, FontFamily -> Source Sans Pro}] TemplateBox[{return}, Key0, BaseStyle -> {Notes, FontWeight -> Plain, FontFamily -> Source Sans Pro}]](Files/ChoiceDialog.en/5.png) returns val1, while pressing returns val1, while pressing or closing the window returns val2. or closing the window returns val2.
- ChoiceDialog allows the sequence of buttons to linewrap by default if needed, and supports the same Appearance option settings as SetterBar to specify other button configurations.
- ChoiceDialog by default puts up a notebook with a typical choice dialog appearance. The option settings include WindowFloating->False, WindowSize->All, and WindowTitle->None.
- ChoiceDialog by default puts up a dialog in the middle of the main display screen. Explicit settings for WindowMargins override this.
- If the Wolfram System is run without a notebook front end, ChoiceDialog gives choices in a textual form.
Examples
open all close allTech Notes
Related Guides
History
Introduced in 2007 (6.0) | Updated in 2008 (7.0) ▪ 2020 (12.1)
Text
Wolfram Research (2007), ChoiceDialog, Wolfram Language function, https://reference.wolfram.com/language/ref/ChoiceDialog.html (updated 2020).
CMS
Wolfram Language. 2007. "ChoiceDialog." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/ChoiceDialog.html.
APA
Wolfram Language. (2007). ChoiceDialog. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ChoiceDialog.html
BibTeX
@misc{reference.wolfram_2025_choicedialog, author="Wolfram Research", title="{ChoiceDialog}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ChoiceDialog.html}", note=[Accessed: 30-October-2025]}
BibLaTeX
@online{reference.wolfram_2025_choicedialog, organization={Wolfram Research}, title={ChoiceDialog}, year={2020}, url={https://reference.wolfram.com/language/ref/ChoiceDialog.html}, note=[Accessed: 30-October-2025]}
 
      