Hide Label Text in App Designer

33 次查看(过去 30 天)
Hi All,
sorry if this might seem a stupid question.
I'm developing an app using App Designer. The user can enter several parameters, which can change according to the selected mode. My goal is to disable and hide all the edit fields releated to the parameters not needed in a specific mode. I'm able to fo that for the numeric fields, setting "Editable" and "Visible" properties to 'off'. E.g.:
app.Start.Editable = 'off';
app.Start.Visible = 'off';
This actually works, making the value uneditable and hiding the entire box. The only thing which I cannot hide is the label which is automatically created. Which is the correct way to reference that label? I tried (with no success) something like:
app.Start.Label = 'off'
or
app.Start.Tag = ''
Thanks very much for your help!

采纳的回答

Subhadeep Koley
Subhadeep Koley 2019-10-29
Some components, such as edit fields and sliders, are grouped with a label when you drag them onto the canvas. These labels do not appear in the Component Browser by default, but you can add them to the list by right-clicking anywhere in the Component Browser and selecting Include component labels in Component Browser. (Refer to the image below)
hideLabel.png
After enabling this option you can refer those labels in the Code View to set their visibility to ‘off’ (Refer to the code below)
app.EditFieldLabel.Visible = 'off';
However, if you do not want the component to have a label in the first place, you can exclude it by pressing and holding the Ctrl key as you drag the component onto to the canvas.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by