| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
h = dialog('PropertyName',PropertyValue,...)
h = dialog('PropertyName',PropertyValue,...) returns a handle to a dialog box. The dialog box is a figure graphics object with properties recommended for dialog boxes. You can specify any valid figure property value except DockControls, which is always off.
The properties that dialog sets and their values are
| Property | Value |
|---|---|
| 'BackingStore' | 'off' |
| 'ButtonDownFcn' | 'if isempty(allchild(gcbf)), close(gcbf), end' |
| 'Colormap' | [] |
| 'Color' | DefaultUicontrolBackgroundColor |
| 'DockControls' | 'off' |
| 'HandleVisibility' | 'callback' |
| 'IntegerHandle' | 'off' |
| 'InvertHardcopy' | 'off' |
| 'MenuBar' | 'none' |
| 'NumberTitle' | 'off' |
| 'PaperPositionMode' | 'auto' |
| 'Resize' | 'off' |
| 'Visible' | 'on' |
| 'WindowStyle' | 'modal' |
Note By default, the dialog box is modal. A modal dialog box prevents the user from interacting with other windows before responding. For more information, see WindowStyle in the MATLAB Figure Properties. |
The default ButtonDownFcn, if isempty(allchild(gcbf)), close(gcbf), end, causes the dialog to terminate itself when clicked as long as it contains no child objects. Replace it with another callback or an empty callback if you do not want this behavior. You can do this only from a script or function if the dialog is modal (the default WindowStyle).
Any parameter from the figure function is valid for this function.
out = dialog;
out = dialog('WindowStyle', 'normal', 'Name', 'My Dialog');errordlg, helpdlg, inputdlg, listdlg, msgbox, questdlg, warndlg
Predefined Dialog Boxes for related functions
![]() | diag | diary | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |