how to add elements to listbox and retrieve(select) item from listbox
10 views (last 30 days)
Show older comments
Hi,
i am trying to add multiple items once per time to a blank listbox and allowing them to display on the listbox and retrieve it to string( to command window or text area) at the end.
i have read some documents about how to do it, but i just cant find the right property to do it, what i have now is app.PlayList.setSelectedItems, it only allows me to add one item to the listbox, and if i want to add more, it gonna cover the previous one.
i havent figure this out yet, so i dont know how to do the retrieve.
I am new to Matlab and app designer, so if you dont mind please be precise.
thank you very much.
0 Comments
Answers (1)
Cris LaPierre
on 14 Dec 2021
Edited: Cris LaPierre
on 14 Dec 2021
You could use indexing to append a new value to the bottom of your listbox. Something like this should work (where newItem is a variable containing the text you want to add to your listbox.
app.PlayList.Items(end+1) = {newItem};
0 Comments
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!