Azzera filtri
Azzera filtri

Configure GUI listbox to initially have no selections

2 visualizzazioni (ultimi 30 giorni)
When I populate a listbox with a list of filenames, the first string in the list is always highlighted. I want it so nothing is selected upon initial loading.
I use:
set(handles.files, 'String', handles.list_names,'Value',0)
handles.files is the listbox, and handles.list_names are the strings that will be put in the listbox. I added the 'Value',0 part, but then I get the error:
Warning: multi-selection listbox control requires that Value be an integer within String range Control will not be rendered until all of its parameter values are valid
Any ideas?

Risposta accettata

Walter Roberson
Walter Roberson il 23 Gen 2013
I do not see any mechanism for this.
When I need to do something like this, I usually add a header line such as 'Choose File' as the first string (the one that gets highlighted), and then I program my functions to know that value 1 means nothing selected.

Più risposte (0)

Categorie

Scopri di più su Interactive Control and Callbacks 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