Select all the data in listbox using single click of pushbutton
7 ビュー (過去 30 日間)
古いコメントを表示
I have a GUI with 3 pushbuttons(Load, Select All & Extract)and listboxDATA. I am able to import data in the listbox using load but how do I set callback for select_all to select all the data in the listboxDATA. I can select all the data individually in listbox but that could be more than 200 lines.
0 件のコメント
採用された回答
Chris Perkins
2017 年 11 月 16 日
Hi Ghanshyam,
In your 'Select All' pushbutton callback, you can add the following code to select all elements currently displayed in your listbox:
sizeOfListBox = numel(get(handles.listbox1, 'String'));
set(handles.listbox1,'value',1:sizeOfListBox);
You can replace 'listbox1' with the Tag of your custom listbox.
Note: You will also need to adjust the 'Max' and 'Min' properties of the Listbox so that multiple item selection is allowed. 'Max' must be at least 2 more than 'Min'.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!