anyway to call checkbox in appdesigner programmatically?

9 次查看(过去 30 天)
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 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by