msgbox - Create and open message box

Syntax

h = msgbox(Message)
h = msgbox(Message,Title)
h = msgbox(Message,Title,Icon)
h = msgbox(Message,Title,'custom',IconData,IconCMap)
h = msgbox(...,CreateMode)

Description

h = msgbox(Message) creates a message dialog box that automatically wraps Message to fit an appropriately sized figure. Message is a string vector, string matrix, or cell array. msgbox returns the handle of the message box in h.

h = msgbox(Message,Title) specifies the title of the message box.

h = msgbox(Message,Title,Icon) specifies which icon to display in the message box. Icon is 'none', 'error', 'help', 'warn', or 'custom'. The default is 'none'.

h = msgbox(Message,Title,'custom',IconData,IconCMap) defines a customized icon. IconData contains image data defining the icon. IconCMap is the colormap used for the image.

h = msgbox(...,CreateMode) specifies whether the message box is modal or nonmodal. Optionally, it can also specify an interpreter for Message and Title.

If CreateMode is a string, it must be one of the values shown in the following table.

CreateMode ValueDescription
'modal'

Replaces the message box having the specified Title, that was last created or clicked on, with a modal message box as specified. All other message boxes with the same title are deleted. The message box which is replaced can be either modal or nonmodal.

'non-modal' (default)

Creates a new nonmodal message box with the specified parameters. Existing message boxes with the same title are not deleted.

'replace'

Replaces the message box having the specified Title, that was last created or clicked on, with a nonmodal message box as specified. All other message boxes with the same title are deleted. The message box which is replaced can be either modal or nonmodal.

If CreateMode is a structure, it can have fields WindowStyle and Interpreter. The WindowStyle field must be one of the values in the table above. Interpreter is one of the strings'tex' or 'none'. The default value for Interpreter is 'none'.

See Also

dialog, errordlg, helpdlg, inputdlg, listdlg, questdlg, warndlg

figure, textwrap, uiwait, uiresume

Predefined Dialog Boxes for related functions

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS