How can I disable all of the objects in a UIBUTTONGROUP or UIPANEL at the same time?

67 views (last 30 days)
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?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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');
  2 Comments

Sign in to comment.

More Answers (2)


Wagih Abu Rowin
Wagih Abu Rowin on 25 Oct 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')

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!