How can I change the drop-down menu options in App Designer?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 18 Avr 2018
Réponse apportée : MathWorks Support Team
le 18 Avr 2018
How can I change the drop-down menu options in App Designer?
I am using appdesigner to build GUIs. In some cases, I would like to be able to change the drop-down choices after the GUI is opened, based on the context.
Réponse acceptée
MathWorks Support Team
le 18 Avr 2018
You can do this by modifying the "Items" property of DropDown.
For example, the following code within a CheckBox's callback will change the options you have in the DropDown object:
>> value = app.CheckBox.Value;
>> if value == 1
>> app.DropDown.Items = {'Option 3', 'Option 4'};
>> else
>> app.DropDown.Items = {'Option 1', 'Option 2'};
>> end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!