Changing listbox max and min values from within a program (GUIDE)

조회 수: 3 (최근 30일)
Tiburtius
Tiburtius 2016년 3월 3일
댓글: Tiburtius 2016년 3월 3일
Hi!
I'm creating a GUI using GUIDE. Among other things, I will have a listbox whose items will change depending on user input. I would like to make it possible to make multiple selections in this listbox; in fact it should be possible to select all items. However, I can't set the max min values beforehand in GUIDE as the number of items in the listbox may change.
To further illustrate, let's say my program implements the phonebooks for all employees at a company. I have a global structure with all employees, each of which has a name and a cell array with the name of their contacts and a cell array with corresponding phone numbers. Let's say I have a popup menu where I can select one the employees. In my listbox, I would then like to display all the contacts of that employee. For example, I would then like to display (i.e. display()) the phone numbers for all selected contacts in that listbox.

채택된 답변

Adam
Adam 2016년 3월 3일
GUIDE GUI components are all stored in the 'handles' structure which is accessible in every (auto-generated) callback within your GUI. You should always give your components sensible tag names so you know how to access them again easy so e.g.
handles.listboxContacts.Max = 0;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by