How to input data in listbox

4 次查看(过去 30 天)
dmfwlansejr
dmfwlansejr 2021-7-15
回答: Chunru 2021-7-15
In App Designer
How to input data in the listbox
Give me example mlapp file or code !

回答(1 个)

Chunru
Chunru 2021-7-15
Here is the example from documentation of uilistbox:
function selectlistbox
fig = uifigure('Position',[100 100 350 275]);
% Create text area
txt = uitextarea(fig,...
'Position',[125 90 100 22],...
'Value','First');
% Create list box
lbox = uilistbox(fig,...
'Position',[125 120 100 78],...
'Items',{'First','Second','Third'},...
'ValueChangedFcn', @updateEditField);
% ValueChangedFcn callback
function updateEditField(src,event)
txt.Value = src.Value;
end
end

类别

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