Select all elements in App Designer List Box

3 views (last 30 days)
When i create an App with a List Box in GUIDE. I can select all the elements with crtl-A or ctrl and drag an drop.
If i do the same in App Designer. I does not work (Multiselect enabled) i have to select every single element with a mouseclick.
Any way to change this?
Thanks for your help!

Answers (1)

Laurence Pridmore
Laurence Pridmore on 8 Nov 2019
I too wish to know this. I have a checkbox "Select all" that when checked should select all the items in the associated list box. The only code snippet I can find to do this is;
sizeOfListBox = numel(get(handles.SelectAllCheckBox, 'String'));
set(handles.SelectAllCheckBox, 'value',1:sizeOfListBox);
but this only works in GUIDE as far as I understand and I get an *Undefined variable "handles" error. Should "handles" be defined somehow and of so, where?
The rest of my code is working fine, I can multi select items in the listbox with CTRL and the output is as expected.
Another workaround to select all items is to select the first item in the list then SHIFT-click the last item, vis a vis typical Windows behaviour.

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!