How Enable and disable panel by popup menu selections
4 次查看(过去 30 天)
显示 更早的评论
In my program i want to do following in GUI
i select first option from popup menu at same time panel_1 is enable and panel_2 is disable
when i select another option at that time panel_1 is disable and panel_2 is enable
1 个评论
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.
回答(3 个)
Walter Roberson
2012-7-29
uipanel cannot be enabled or disabled: they can just be set to be visible or not.
switch get(hObject, 'Value')
case 1:
set(handles.panel_1, 'Visible', 'on');
set(handles.panel_2, 'Visible', 'off');
case 2:
set(handles.panel_1, 'Visible', 'off');
set(handles.panel_2, 'Visible', 'on');
end
0 个评论
Lukasz Pater
2016-11-28
Parameter Enable for popup menu control:
- on - regular menu
- off - menu blocked with grey background
- inactive - menu blocked without grey background
1 个评论
Walter Roberson
2016-11-28
That is correct for uicontrol style popup . It does not apply for uipanel
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!