clear listbox in gui

조회 수: 24 (최근 30일)
marwa marwan
marwa marwan 2017년 12월 15일
댓글: Hossein Davari 2021년 3월 5일
I have a listbox in gui that display the result of execution... when I want to run another time I want the past resut in listbox to be removed and display the message(please wait the result)and then the new result is display i just dont know how to clear the listbox and display that message.

답변 (2개)

Image Analyst
Image Analyst 2017년 12월 15일
Did you try to set it to null?
handles.listbox1.String = [];
  댓글 수: 5
Image Analyst
Image Analyst 2017년 12월 17일
Using a waitbar is not required for clearing a listbox. That's a totally separate issue. Perhaps you cleared it and immediately went into a computationally intensive loop and so the screen did not refresh. To have it refresh immediately, use drawnow.
handles.listbox1.String = [];
drawnow;
marwa marwan
marwa marwan 2017년 12월 18일
I know its separate issue but I just didnt know why my list box didnt refreshed so I used wait bar just to knowledge the GUI user that the program is under execution thank you for explination that is exactly what I want..

댓글을 달려면 로그인하십시오.


Hossein Davari
Hossein Davari 2021년 3월 5일
ListBoxHandle.Items = {}; %clear the list of items in listbox
edg = errordlg('Message');
waitfor(edg) %program will continue when the dialog box is closed.
drawnow
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 3월 5일
Items is, I suspect, for list boxes in app designer.
Hossein Davari
Hossein Davari 2021년 3월 5일
Yes

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by