필터 지우기
필터 지우기

Configure GUI listbox to initially have no selections

조회 수: 2 (최근 30일)
Jared
Jared 2013년 1월 23일
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?

채택된 답변

Walter Roberson
Walter Roberson 2013년 1월 23일
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.
  댓글 수: 1
Jared
Jared 2013년 1월 23일
Bummer, not a huge deal, just trying to clean things up a bit.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by