How can I disable all of the objects in a UIBUTTONGROUP or UIPANEL at the same time?
8 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2009-6-27
编辑: MathWorks Support Team
2022-2-23
I would like to disable all of the objects located inside one of the container objects (UIPANEL and UIBUTTONGROUP). Is there a property of the container that does this?
采纳的回答
MathWorks Support Team
2009-6-27
The container objects do not have a property that can disable all of its children. However, you can obtain the container's children, and then modify their Enable properties with a single command:
% Here 'c' is the handle to a container object
children = get(c,'Children');
set(children,'Enable','inactive');
1 个评论
Eric Sargent
2020-12-9
编辑:MathWorks Support Team
2022-2-23
As of R2020b ButtonGroup and Panel both support Enable when the button group or panel is parented to a uifigure.
更多回答(2 个)
Eric Sargent
2020-12-9
编辑:MathWorks Support Team
2022-2-23
As of R2020b ButtonGroup and Panel both support Enable when the button group or panel is parented to a uifigure.
0 个评论
Wagih Abu Rowin
2020-10-25
For Matlab App Designer 2018 and up you should use 'Enable','off' as:
% Here app.UIFigure is the main handel or container object
children = get(app.UIFigure,'Children');
set(children(isprop(children,'Enable')),'Enable','off')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!