How can I change the drop-down menu options in App Designer?
5 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2018 年 4 月 18 日
回答済み: MathWorks Support Team
2018 年 4 月 18 日
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.
採用された回答
MathWorks Support Team
2018 年 4 月 18 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!