简体   繁体   中英

Editing checkboxes in a Matlab GUI

Using the GUI guide editor in Matlab 2008b, I have run into a problem with check boxes. I have looked at numerous online tutorials and such but haven't found a solution. My problem is that I have a button that resets everything in the GUI (editing a picture). However, there are checkboxes in my GUI and I can't figure out how to deselect these checkboxes when the reset button is pressed.

Additional: The actions that the checkboxes perform are already reset, I just need to get the check in the box to be reset

For unselecting checkboxes, set the 'Value' property to 0 (or whatever the 'Min' property is set to, if you changed it). It would look like:

set(hCheck1,'Value',0);
%OR
set(hCheck1,'Value',get(hCheck1,'Min'));  % If 'Min' is something besides 0

Here, hCheck1 is the handle of the first checkbox (which I think you can get from the handles structure if creating your GUI in GUIDE). You would then repeat this for each of the other two checkboxes. If a checkbox is already unchecked, the above will have no effect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM