How to select multiple option on listbox?
20 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/346902/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/346905/image.png)
Hope this helps.
更多回答(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!