How do I get the UI type of a dialog box?

1 view (last 30 days)
I have the following code:
h = warndlg;
get(h,'Type');
The above code returns the handle type to be figure. I want to see 'helpdlg' or 'errordlg' or 'warndlg'.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The functionality you are seeing is because the dialog boxes are built using the handle graphics infrastructure. All the dialog boxes are contained within a figure object, hence the handle type is figure.
To work around this limitation you can query the "TAG" property of the object as follows:
h = warndlg;
get(h,'Tag');
The above code returns:
Msgbox_Warning Dialog
The limitation of the above workaround is that "TAG" is not a read only property and can be changed by users.

More Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!