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;
  1 件のコメント
Tiburtius
Tiburtius 2016 年 3 月 3 日
Thanks! 'twas a silly question I guess, but I'm new to GUIDE.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by