Open and close a panel in matlab GUI by clicking on a pushbutton

4 visualizaciones (últimos 30 días)
Kaavya N
Kaavya N el 8 de Jun. de 2021
Comentada: Kaavya N el 21 de Jun. de 2021
I have 2 pushbuttons in my matlab code with 2 panels overlapping each other . I want to select panel1 when I click on button1 and panel2 when I click on button2. Panel1 is visible but when I click on button2 its blank. This is the code i've used in the respective pushbutton functions.
set(handles.panel1, 'visible','on');
set(handles.panel2, 'visible','off' );
set(handles.panel1, 'visible','off');
set(handles.panel2, 'visible','on' );
Is there anything i'm missing

Respuestas (1)

Reshma Nerella
Reshma Nerella el 11 de Jun. de 2021
Hi,
When you are trying to place one panel over other in the same position , there's a possibilty that you end up placing second panel inside the first one. Verify in the component browser and ensure that it doesn't happen.
The issue you mentioned comes in this case when one Panel is parent to other, else the code you wrote would suffice.
Hope this helps!
  1 comentario
Kaavya N
Kaavya N el 21 de Jun. de 2021
Thanks for the answer,
Is it possible to create 4 pushbuttons and 4 panels and make them work in GUIDE gui.
When I tried with 3 pushbuttons and 3 panels , the first and the last panel was visible but the middle one didnt work .

Iniciar sesión para comentar.

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by