How to select only two items from the list box?
Show older comments
I want to select only two items from a list box. The list box should not accept more than two selected items.
Please provide an example for this.
Accepted Answer
More Answers (1)
Walter Roberson
on 20 Jan 2011
1 vote
There is no (documented) MATLAB mechanism for restricting the number of multi-selected items in a listbox. Your callback function will need to detect the situation and decide what to do, such as setting the Value property to only reflect the first (or last) two of the chosen values, or popping up an error dialog.
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!