Creating Graphical User Interfaces |
Check boxes generate an action when checked and indicate their state as checked or not checked. Check boxes are useful when providing the user with a number of independent choices that set a mode (e.g., display a toolbar or generate callback function prototypes).
The Value
property indicates the state of the check box by taking on the value of the Max
or Min
property (1 and 0 respectively by default):
You can determine the current state of a check box from within its callback by querying the state of its Value
property, as illustrated in the following example:
function checkbox1_Callback(hObject, eventdata, handles) if (get(hObject,'Value') == get(hObject,'Max'))% then checkbox is checked-take approriate action
else% checkbox is not checked-take approriate action
end
Radio Buttons | Edit Text |