Hide Label Text in App Designer

63 visualizzazioni (ultimi 30 giorni)
Jacopo Morosi
Jacopo Morosi il 24 Ott 2019
Commentato: Jacopo Morosi il 29 Ott 2019
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!

Risposta accettata

Subhadeep Koley
Subhadeep Koley il 29 Ott 2019
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.

Più risposte (0)

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by