![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/280834/image.png)
How to create a menu with checkbox in app designer?
54 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I've been working on a gui in app designer for a while now. I'd like to add a top menu bar feature that contains a dropdown menu with four different fields. In each field, I'd like there to be at least two checkboxes. The purpose is for the user to select which units they'd like for their data to be processed and plotted (see image below).
I plan on using the checkbox to indicate which option is selected in each menu, as well as editing a public property that contains conversions to use within some code. When one checkbox is selected in each sub menu, I'd also like to deselect the other checkboxes within the same submenu
(e.g. distance> meters[x], feet[ ] --> distance> meters[ ], feet [x])
I've read the matlab documentation from this link https://www.mathworks.com/help/matlab/ref/uimenu.html, but I don't understand how to create the checkbox option in app designer.
Can someone explain to me how to do so in design view/code view ?
Sample of menu (meters and feet should be checkboxes):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/280774/image.png)
0 个评论
采纳的回答
Mohammad Sami
2020-3-31
There is a property "Checked" for uimenu.
In app designer select the menu and in property inspector tick the checked box.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/280834/image.png)
3 个评论
MCL MATLABFOUR
2021-5-20
When I check the checked box and run the code, it does not give me the option to check or uncheck the box. Do you know how to fix that? I would like to give the user to check certain options but not have to check all of the boxes
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!