Enable/disable dropdowns when checkbox checked/unchecked in MATLAB2019A app designer
조회 수: 10 (최근 30일)
이전 댓글 표시
I want to disable the given dropdown if the checkbox is selected and enable it once checkbox is unchecked.
How should be the code?
댓글 수: 0
답변 (1개)
Kojiro Saito
2019년 11월 6일
First, add ValueChangedFcn callback from app.CheckBox.
Then, define CheckBoxValueChanged function as the follows.s
% Value changed function: CheckBox
function CheckBoxValueChanged(app, event)
value = app.CheckBox.Value;
if value == true
% If checkbox is checked, make dropdown disable
app.DropDown.Enable = false;
else
% If checkbox is unchcked, make dropdown enable
app.DropDown.Enable = true;
end
end
Here is a screenshot.
댓글 수: 9
Paolo Volpe
2022년 11월 17일
If I want to save my output file from the APP designer which function can I use? I didn't find nothing correlated to my question on the web. Thank you
Kojiro Saito
2022년 11월 17일
You can use save (as .mat file), writetable (as .csv or .txt, .xlsx) and so on.
참고 항목
카테고리
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!