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

5 ビュー (過去 30 日間)
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
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
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
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.

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

カテゴリ

Help Center および File ExchangeDevelop uifigure-Based Apps についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by