How to disable a panel in GUIDE ?

i have a panel with a no. of push buttons and other test fields, and i want to disable them till a radio button is selected; So, how can disable an entire panel without going for each component and disable them separately ??
I am using Matlab 2011a.

1 Comment

As of R2020b ButtonGroup and Panel both support Enable when the button group or panel is parented to a uifigure.

Sign in to comment.

 Accepted Answer

You could set() the entire uipanel to have Visible 'off'
But if you want the panel to be still visible, then
set(findall(PanelHandle, '-property', 'enable'), 'enable', 'off')

15 Comments

thank you for the answer.
but please tell how to select a particular panel among no. of panels ?
PanelHandle should be the handle of the panel you want to disable.
How are you distinguishing them in your code?
now its working; i used the following
set(findall(handles.PanelHandle, '-property', 'enable'), 'enable', 'off')
since I was executing the line from the opening function of the figure.
Thanks a lot for your help ...
just out of curiosity i am asking,
i couldn't find the enable property of a panel from the property inspector, but in the above line of code we are able to access it .. can u provide some explanation ?
There is no enable property of a uipanel.
findall() looks at all the children (recursively) of the given handle (the panel), and in the form given looks only for the children which have an 'enable' property; it returns that list of handles, and the set() sets the enable property of those handles to 'off'
enable is not property of panel. after enable of if convert into on than this is not working
praveen chandaliya:
This code never tries to set the enable property of a panel. The findall() looks inside the panel to findall all contained graphics object that have an "enable" property, and it sets their "enable" status to 'off'
Walter thank for clear my doubt. but i want to know after "enable" status go "off". if am required to "on" status of panel gui object than how to "on" its
set(findall(handles.uipanel9, '-property', 'Visible'), 'Visible', 'on')
this code not working
set(findall(PanelHandle, '-property', 'enable'), 'enable', 'on')
not working either
It works in my tests. Which MATLAB version are you using? Are you getting any error message?
Try
handles.uipanel9.Visible = 'on'; % Or 'off'
handles.uipanel9.Enable = 'on'; % Or 'off'
i am not getting error message
OK, good. So I assume it's working now.
Please post a small example that demonstrates the problem.

Sign in to comment.

More Answers (1)

Eric Sargent
Eric Sargent on 9 Dec 2020
As of R2020b ButtonGroup and Panel both support Enable when the button group or panel is parented to a uifigure.

Categories

Find more on App Building in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!