Select all elements in App Designer List Box

조회 수: 5 (최근 30일)
Christian Tieber
Christian Tieber 2019년 6월 7일
답변: Laurence Pridmore 2019년 11월 8일
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!

답변 (1개)

Laurence Pridmore
Laurence Pridmore 2019년 11월 8일
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.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by