フィルターのクリア

How should I know whether and which checkboxs are selected?

4 ビュー (過去 30 日間)
Donghui  Sun
Donghui Sun 2013 年 8 月 26 日
In main panel, there are several checkboxs, such as A...D. Each checkbox is bounding a selection for my application.How should I know whether and which checkboxs are selected?
Any suggestions?

採用された回答

Image Analyst
Image Analyst 2013 年 8 月 26 日
checkbox1State = get(handles.checkbox1, 'Value');
checkbox2State = get(handles.checkbox2, 'Value');
checkbox3State = get(handles.checkbox3, 'Value');
and so on.
  1 件のコメント
Donghui  Sun
Donghui Sun 2013 年 8 月 26 日
Thanks. I have read the help document about this issue. And I can determine the current state of a check box from within its callback by querying the state of its Value property .
if (get(hObject,'Value') == get(hObject,'Max'))
% Checkbox is checked-take appropriate action
handles.chexkbox1 = 1
else
handles.ckeckbox1 = 0;
end

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by