how to click push button one by one without visible the button?

1 vue (au cours des 30 derniers jours)
nur sahida
nur sahida le 6 Mar 2019
Hi, i need some help about push button.
I have 3 push button then i need to make click the push button one by one, like if i click the first push button the second and third button cannot be work until the process in first push button done..
TQ

Réponses (1)

Dennis
Dennis le 6 Mar 2019
You can use the enable property of a pushbutton.
for i=3:-1:1
h.pb(i)=uicontrol('style','pushbutton','position',[50 50+(40*i) 80 40],'String',sprintf('Button %d',i));
end
set(h.pb(:),'callback',{@MyCallback,h});
function MyCallback(hObj,~,h)
set(h.pb(:),'enable','off');
set(hObj,'Enable','On');
pause(3)
set(h.pb(:),'enable','on');
end

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by