clear listbox in gui

24 Ansichten (letzte 30 Tage)
marwa marwan
marwa marwan am 15 Dez. 2017
Kommentiert: Hossein Davari am 5 Mär. 2021
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.

Antworten (2)

Image Analyst
Image Analyst am 15 Dez. 2017
Did you try to set it to null?
handles.listbox1.String = [];
  5 Kommentare
Image Analyst
Image Analyst am 17 Dez. 2017
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 am 18 Dez. 2017
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..

Melden Sie sich an, um zu kommentieren.


Hossein Davari
Hossein Davari am 5 Mär. 2021
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 Kommentare
Walter Roberson
Walter Roberson am 5 Mär. 2021
Items is, I suspect, for list boxes in app designer.
Hossein Davari
Hossein Davari am 5 Mär. 2021
Yes

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by