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

1 visualizzazione (ultimi 30 giorni)
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

Risposte (1)

Dennis
Dennis il 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

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by