Main Content

removeDialogControl

Class: Simulink.Mask
Namespace: Simulink

Remove dialog control from mask dialog box

Syntax

maskObj.removeDialogControl(controlIdentifier)
success = maskObj.removeDialogControl(controlIdentifier)

Description

maskObj.removeDialogControl(controlIdentifier) removes the dialog controls such as text, button, hyperlink, and container specified by controlIndentifier from the mask dialog box. To remove a dialog control from a mask dialog box, first get the mask object and assign it to a variable maskObj.

success = maskObj.removeDialogControl(controlIdentifier) returns a logical 1 (true) when the dialog control is successfully removed or logical 0 (false) if the dialog control element is not removed from the mask dialog box.

Input Arguments

expand all

Identifier of the mask dialog control, specified as a string scalar or character vector.

Example: "text_tag"

Data Types: string | char

Examples

expand all

Remove a dialog control element from the mask dialog box using removeDialogControl.

Create a new model Engine and add a Gain block.

new_system("Engine");
add_block("built-in/Gain","Engine/gain");
save_system;
open_system("Engine");

Create a mask on the Gain block and assign the mask object to the variable maskObj.

maskObj = Simulink.Mask.create(gcb);

Add a text dialog control in the mask dialog box and set a prompt.

maskText = maskObj.addDialogControl("text","text_tag"); 
maskText.Prompt = "Enable range checking";
save_system;

Remove the text dialog control text_tag.

maskObj.removeDialogControl("text_tag");

Alternatives

You can manage dialog control elements using the Parameters & Dialog pane in the Mask Editor dialog box. For more information, see Parameters & Dialog Pane.

Version History

Introduced in R2013b