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

1 回表示 (過去 30 日間)
nur sahida
nur sahida 2019 年 3 月 6 日
回答済み: Dennis 2019 年 3 月 6 日
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

回答 (1 件)

Dennis
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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by