Automatically update a checkbox in list

3 ビュー (過去 30 日間)
Mai Le Thai
Mai Le Thai 2018 年 12 月 17 日
コメント済み: Mai Le Thai 2018 年 12 月 17 日
I can get the value from the checkboxlist : m= get(handles.checkBoxList, 'Value');
How can my checkbox automatically update, when the value m could be changed?
Capture.PNG

採用された回答

Rik
Rik 2018 年 12 月 17 日
You mean you want to run some code when the box is clicked? That can be done with the callback property.
You can set the Callback property of many objects. If you do, use a function name with an @ in front, or a char array that can be evaluated to valid code. (like @MyFunction or 'disp(''you pushed the button'')') Callback functions will be called with two arguments: the first is a handle to the callback object, the second is eventdata that may contain special information. To get access to your data, just use handles=guidata(gcbo);. You can replace the gcbo function with the name of the first input to your callback function if you prefer. More information about callbacks can be found in multiple places in the doc, for example here.
  1 件のコメント
Mai Le Thai
Mai Le Thai 2018 年 12 月 17 日
thanks for your answer!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by