anyway to call checkbox in appdesigner programmatically?

조회 수: 18 (최근 30일)
Yu Li
Yu Li 2019년 9월 12일
댓글: Fabian Schnurre 2023년 12월 3일
Hi:
is there anyway to call checkbox in appdesigner programmatically?
Thanks!
Yu
  댓글 수: 2
Lewis Maina
Lewis Maina 2020년 3월 27일
yes , below is a section of my code which unticks ShowMultiplicationDivisionOptionsCheckBox.Value programmatically.
hope this helps you
function ShowAdvancedOptionsCheckBoxValueChanged(app, event)
value = app.ShowAdvancedOptionsCheckBox.Value;
switch value
case 0
case 1
app.ShowMultiplicationDivisionOptionsCheckBox.Value = false;
end
Fabian Schnurre
Fabian Schnurre 2023년 12월 3일
How does this work on a tree checkbox? there are no values for nodes

댓글을 달려면 로그인하십시오.

채택된 답변

Ajay Pattassery
Ajay Pattassery 2019년 9월 17일
I assume that you have already created a checkBox in app-designer, and you want to check or uncheck the checkBox programmatically.
You could set the value of CheckBox.Value to one for checking the box and toggling to zero to uncheck the box.
app.CheckBox.Value = 1;
(In the above example, CheckBox handle is stored in the structure app)
  댓글 수: 2
Yu Li
Yu Li 2019년 9월 17일
sorry, I did not describe my question clearly.
I do not mean change the value by click the checkbox. I want to use command to change the app.Checkbox.Value=1, and it will automatically run the function belong to it.
Thanks!
Yu
Adam
Adam 2019년 9월 17일
Have your checkbox callback call a new function, passing in the checkbox value and have your other code call that same function.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by