how to click push button one by one without visible the button?
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Dennis
2019-3-6
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!