MATLAB Function Reference Previous page   Next Page
questdlg

Create and display question dialog box

Syntax

Description

button = questdlg('qstring') displays a modal dialog presenting the question 'qstring'. The dialog has three default buttons, Yes, No, and Cancel. If the user presses one of these three buttons, button is set to the name of the button pressed. If the user presses the close button on the dialog, button is set to the empty string. If the user presses the Return key, button is set to 'Yes'. 'qstring' is a cell array or a string that automatically wraps to fit within the dialog box.

button = questdlg('qstring','title') displays a question dialog with 'title' displayed in the dialog's title bar.

button = questdlg('qstring','title','default') specifies which push button is the default in the event that the Return key is pressed. 'default' must be 'Yes', 'No', or 'Cancel'.

button = questdlg('qstring','title','str1','str2','default') creates a question dialog box with two push buttons labeled 'str1' and 'str2'. 'default' specifies the default button selection and must be 'str1' or 'str2'.

button = questdlg('qstring','title','str1','str2','str3','default') creates a question dialog box with three push buttons labeled 'str1', 'str2', and 'str3'. 'default' specifies the default button selection and must be 'str1', 'str2', or 'str3'.

In all cases where 'default' is specified, if'default' is not set to one of the button names, pressing the Return key displays a warning and the dialog remains open.

See Also

inputdlg, textwrap


Previous page  quadv quit Next page

© 1994-2005 The MathWorks, Inc.