필터 지우기
필터 지우기

Searching for text in listbox without deselecting current choice

조회 수: 3 (최근 30일)
Anthony
Anthony 2015년 6월 17일
댓글: Image Analyst 2015년 6월 17일
Hi all,
I have a list of 23,000 choices in a listbox in my GUI. I need to be able to select about 10 options at once. I have the multiselect setup, but because I have 23,000 entries, I can't manually scroll through to select the entries I want. The only way to search through the entries is to type, but when I type, it deselects whatever I had already selected.
Is there any way to implement a search bar above the listbox that will search through, but not select/deselect what appears in the listbox until I click the result?
That was just my idea, if there is a better solution feel free to share.
Thank you!

채택된 답변

Ingrid
Ingrid 2015년 6월 17일
why not add a table to your GUI where you store the options that you click? Just add a pushbutton that clears the table when you want to select a new list. This seems the easiest way to implement this
  댓글 수: 2
Anthony
Anthony 2015년 6월 17일
I'm going to see if this works, I like this idea a lot. Even better than what I had described.
Image Analyst
Image Analyst 2015년 6월 17일
You might think of a better way than presenting your user with a listbox 23,000 lines long. It must be torture to scroll through that to find about 10 that you want to select. Maybe a popup or radio buttons to filter the list to narrow it down to a manageable number, instead of something that would choke a whale.

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

추가 답변 (1개)

Image Analyst
Image Analyst 2015년 6월 17일
You can get all the listbox items in a cell array like this:
allItems = get(handles.listbox1, 'String');
Now you can search all those items with ismember() or strfind(). It will not change what items are, or are not, selected.
  댓글 수: 1
Anthony
Anthony 2015년 6월 17일
That would work well if I was the one using this, but I'm trying to do this all with a GUI so someone who doesn't know MATLAB will still be able to use the simple program I'm writing.

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

카테고리

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