How can I disable all of the objects in a UIBUTTONGROUP or UIPANEL at the same time?
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 27 Jun. 2009
Bearbeitet: MathWorks Support Team
am 23 Feb. 2022
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?
Akzeptierte Antwort
MathWorks Support Team
am 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');
1 Kommentar
Eric Sargent
am 9 Dez. 2020
Bearbeitet: MathWorks Support Team
am 23 Feb. 2022
As of R2020b ButtonGroup and Panel both support Enable when the button group or panel is parented to a uifigure.
Weitere Antworten (2)
Eric Sargent
am 9 Dez. 2020
Bearbeitet: MathWorks Support Team
am 23 Feb. 2022
As of R2020b ButtonGroup and Panel both support Enable when the button group or panel is parented to a uifigure.
0 Kommentare
Wagih Abu Rowin
am 25 Okt. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Develop uifigure-Based Apps finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!