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

3 Ansichten (letzte 30 Tage)
Tiburtius
Tiburtius am 3 Mär. 2016
Kommentiert: Tiburtius am 3 Mär. 2016
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.

Akzeptierte Antwort

Adam
Adam am 3 Mär. 2016
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;

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by