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

3 views (last 30 days)
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.

Accepted Answer

Adam
Adam on 3 Mar 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;

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!