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

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

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2012년 3월 14일

3 개 추천

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

Avi Pal
Avi Pal 2012년 3월 14일
thank you for the answer.
but please tell how to select a particular panel among no. of panels ?
Walter Roberson
Walter Roberson 2012년 3월 14일
PanelHandle should be the handle of the panel you want to disable.
How are you distinguishing them in your code?
Avi Pal
Avi Pal 2012년 3월 14일
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 ...
Avi Pal
Avi Pal 2012년 3월 14일
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 ?
Walter Roberson
Walter Roberson 2012년 3월 14일
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'
praveen chandaliya
praveen chandaliya 2017년 9월 3일
enable is not property of panel. after enable of if convert into on than this is not working
Walter Roberson
Walter Roberson 2017년 9월 3일
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'
praveen chandaliya
praveen chandaliya 2017년 9월 3일
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
praveen chandaliya
praveen chandaliya 2017년 9월 3일
편집: Image Analyst 2017년 9월 3일
set(findall(handles.uipanel9, '-property', 'Visible'), 'Visible', 'on')
this code not working
set(findall(PanelHandle, '-property', 'enable'), 'enable', 'on')
not working either
Walter Roberson
Walter Roberson 2017년 9월 3일
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'
praveen chandaliya
praveen chandaliya 2017년 9월 4일
matlab15a
praveen chandaliya
praveen chandaliya 2017년 9월 4일
i am not getting error message
Image Analyst
Image Analyst 2017년 9월 4일
OK, good. So I assume it's working now.
Walter Roberson
Walter Roberson 2017년 9월 4일
Please post a small example that demonstrates the problem.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Eric Sargent
Eric Sargent 2020년 12월 9일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Update figure-Based Apps에 대해 자세히 알아보기

태그

질문:

2012년 3월 14일

답변:

2020년 12월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by