anyway to call checkbox in appdesigner programmatically?

19 Ansichten (letzte 30 Tage)
Yu Li
Yu Li am 12 Sep. 2019
Kommentiert: Fabian Schnurre am 3 Dez. 2023
Hi:
is there anyway to call checkbox in appdesigner programmatically?
Thanks!
Yu
  2 Kommentare
Lewis Maina
Lewis Maina am 27 Mär. 2020
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 am 3 Dez. 2023
How does this work on a tree checkbox? there are no values for nodes

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Ajay Pattassery
Ajay Pattassery am 17 Sep. 2019
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 Kommentare
Yu Li
Yu Li am 17 Sep. 2019
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 am 17 Sep. 2019
Have your checkbox callback call a new function, passing in the checkbox value and have your other code call that same function.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by