Scrolling down drop down list
3 次查看(过去 30 天)
显示 更早的评论
Hi,
i am developping an app in app designer, but i am runing out of space for the drop down list. i wonder if there is a way to make a scrolling dropdown list, just like web pages when you want to go further down you just keep clicking on the rectangle think to the right of the screen.
this is my code :
list = load('Vehiclelist.mat');
assignin('base','list', list);
app.VehicleModelDropDown.Items = list.Vehiclelist;
Vehiclelist = [app.VehicleModelDropDown.Items New_Bat_Name];
save('Vehiclelist.mat','Vehiclelist','-append');
app.VehicleModelDropDown.Items = Vehiclelist;
%% scroll(app.VehicleModelDropDown.Items,1,1); %% << Somewhere here i want to put the
%% scrolling thing
thank you
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/354161/image.jpeg)
3 个评论
Adam Danz
2020-8-31
No, I don't believe that's possible. You could shrink the height so that it only shows 1 item at a time but it will still only show 1 line at a time when scrolling through it.
回答(1 个)
Mario Malic
2020-8-31
编辑:Mario Malic
2020-8-31
app.DisplayDropDown.Items = app.Legend_Str; % This is cell 1xn that contains char arrays
This works for me. I believe it appears when the items cannot fit the main window.
You don't have scrolling thing because, most likely you did not load all the data.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/354206/image.png)
1 个评论
Adam Danz
2020-8-31
+1, yes - once the list gets too long it will automatically add a vertical scoll bar.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!