Filter löschen
Filter löschen

Select all elements in App Designer List Box

10 Ansichten (letzte 30 Tage)
Christian Tieber
Christian Tieber am 7 Jun. 2019
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!

Antworten (1)

Laurence Pridmore
Laurence Pridmore am 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.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by