How to select multiple option on listbox?

조회 수: 39 (최근 30일)
Epri Pratiwi
Epri Pratiwi 2020년 8월 13일
댓글: Epri Pratiwi 2020년 8월 17일
I want to select multiple children song title from the listbox1 (left). The only thing I know is only select one by to to move to into listbox2 (right). If somebody know the functio how to do that, let me know :)
% --- Executes on button press in upload.
function upload_Callback(hObject, eventdata, handles)
global MyListOfFiles
global List
global i
if i<16
ListBoxValue = get(handles.listbox1,'value');
f=MyListOfFiles{ListBoxValue};
g=find(strcmp(List,f));
if isempty(g)==1
List(i,:)=MyListOfFiles(ListBoxValue);
set(handles.listbox2,'String',List);
i=i+1;
else
msgbox('you have already selected this song')
end
if i>15
msgbox('Switch to the next tab for operator setting')
end
else
msgbox('you have already selected 15 songs, Switch to the next tab for operator setting')
end
  댓글 수: 2
dpb
dpb 2020년 8월 13일
편집: dpb 2020년 8월 13일
Use the 'MultiSelect','on' property when create the listbox...
Epri Pratiwi
Epri Pratiwi 2020년 8월 17일
thanks!!!

댓글을 달려면 로그인하십시오.

채택된 답변

Prabhanjan Mentla
Prabhanjan Mentla 2020년 8월 17일
Hi,
There is an option to select multiple items in a list box. By default, it is not selected.
Here’s the option for Multiselect in Interactivity under Inspector.
To test, consider a sample case where to display all the items selected in a UI table. However, the order of items in UI table depends on the order of selection from list box.
Hope this helps.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by