Filter löschen
Filter löschen

How Enable and disable panel by popup menu selections

3 Ansichten (letzte 30 Tage)
makarand mali
makarand mali am 29 Jul. 2012
Kommentiert: Eric Sargent am 9 Dez. 2020
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 Kommentar
Eric Sargent
Eric Sargent am 9 Dez. 2020
As of R2020b ButtonGroup and Panel both support Enable when the button group or panel is parented to a uifigure.

Melden Sie sich an, um zu kommentieren.

Antworten (3)

Walter Roberson
Walter Roberson am 29 Jul. 2012
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

Lukasz Pater
Lukasz Pater am 28 Nov. 2016
Parameter Enable for popup menu control:
  • on - regular menu
  • off - menu blocked with grey background
  • inactive - menu blocked without grey background
  1 Kommentar
Walter Roberson
Walter Roberson am 28 Nov. 2016
That is correct for uicontrol style popup . It does not apply for uipanel

Melden Sie sich an, um zu kommentieren.


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

Kategorien

Mehr zu Develop uifigure-Based Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by