How can I disable all of the objects in a "uibuttongroup" or "uipanel" at the same time?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 27 de Jun. de 2009
Editada: MathWorks Support Team
el 30 de Jun. de 2025
I would like to disable all of the objects located inside one of the container objects (uibuttongroup and uipanel). Is there a property of the container that does this?
Respuesta aceptada
MathWorks Support Team
el 10 de Dic. de 2021
Editada: MathWorks Support Team
el 3 de Mzo. de 2025
As of R2020b onwards, both "uibuttongroup" and "uipanel" components support the Enable property when they are parented to a "uifigure". Refer to the ButtonGroup documentation to learn more about this.
For releases before R2020b:
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 comentario
Eric Sargent
el 9 de Dic. de 2020
Editada: MathWorks Support Team
el 30 de Jun. de 2025
As of R2020b ButtonGroup and Panel both support Enable when the button group or panel is parented to a uifigure.
Más respuestas (2)
Eric Sargent
el 9 de Dic. de 2020
Editada: MathWorks Support Team
el 6 de Dic. de 2024
As of R2020b ButtonGroup and Panel both support Enable when the button group or panel is parented to a uifigure.
0 comentarios
Wagih Abu Rowin
el 25 de Oct. de 2020
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 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!