how to add elements to listbox and retrieve(select) item from listbox
10 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Cris LaPierre
2021 年 12 月 14 日
編集済み: Cris LaPierre
2021 年 12 月 14 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!