listdlg, giving memory to list dialog from previous execution.

1 visualizzazione (ultimi 30 giorni)
Hi,
I am using a list dialog in my code, allowing user to select the desired items. I want to introduce some kind of memory to the list dialog so that it remember the previously selected items.
Right now i am using following code for the list dialog. For example
r = {'Crunchy','Creamy','Natural','Chocolate'};
[Selection,ok] = listdlg('ListString',r);
for i = 1 : length(Selection)
some operation...
end
In above example if user has selected Crunchy and Creamy Then i want that next time "Crunchy" and "Creamy" should be pre-selected in the list dialog.
Thanks in advance for your suggestions, tips and hints.
Kind regards, \\ Arsalan

Risposta accettata

Matt Tearle
Matt Tearle il 16 Mar 2011
Will this do what you want?
r = {'Crunchy','Creamy','Natural','Chocolate'};
Selection=[];
for k=1:3
[Selection,ok] = listdlg('ListString',r,'InitialValue',Selection);
% Do more stuff
end

Più risposte (0)

Categorie

Scopri di più su Dialog Boxes in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by