Show TEXT in static text for some time

11 ビュー (過去 30 日間)
Salim Muhammad
Salim Muhammad 2017 年 2 月 1 日
コメント済み: Niels 2017 年 2 月 1 日
Hello, i want make some program that show the text from listbox to static text. there's 2 listbox which have some value. and the smallest value between the two listbox will show in the static text for some time. Some example, in listbox1 theres '4' & '8' and in listbox2 theres '5' & '6'. so then in the static text will show 4 for some time (exmple for 5 sec) and then after the time it will show 5 for some time too and then 6 and lastly 8. Anybody can give me same idea or maybe some program that can be used for this kind of program.
  2 件のコメント
Walter Roberson
Walter Roberson 2017 年 2 月 1 日
Sounds like a job for a timer object.
Salim Muhammad
Salim Muhammad 2017 年 2 月 1 日
How can i use timer object for this kind of program?

サインインしてコメントする。

回答 (1 件)

Niels
Niels 2017 年 2 月 1 日
編集済み: Niels 2017 年 2 月 1 日
if you dont need a generalized solution:
for i=1:2 % else replace 2 with numel(handles.TagAnyListBox.string)
handles.TagOfyourStaticText.String=handles.TagFirstListbox.String{i};
wait(5);
handles.TagOfyourStaticText.String=handles.TagSecondListbox.String{i};
wait(5);
end
handles.tagStaticTxt.string=[];
  3 件のコメント
Salim Muhammad
Salim Muhammad 2017 年 2 月 1 日
Oh, and where should I put this code in my GUI?
Niels
Niels 2017 年 2 月 1 日
replace wait with pause then
for i=1:2 % else replace 2 with numel(handles.TagAnyListBox.String)
handles.TagOfyourStaticText.String=handles.TagFirstListbox.String{i};
pause(5);
handles.TagOfyourStaticText.String=handles.TagSecondListbox.String{i};
pause(5);
end
handles.tagStaticTxt.string=[];
you have to place this whereever you want it to have, i cant guess when you want this to happen. if you want it to happen right after you opened yout GUI place it in the opening function. and dont forget to replace the TAGS. i cant know how you named your listbox or static txt

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by