How can I remove the Default selection in Listbox GUI?

6 次查看(过去 30 天)
I always see the top option in the listbox is default selected. How to remove this default selection?
Please help me. I checked the property inspector but couldn't find any solution. Thanks!

采纳的回答

Adam Danz
Adam Danz 2018-7-20
编辑:Adam Danz 2018-7-20
If you'd rather have the 2nd one as default set the 'Value' property to 2.
If you want there to be no default, set the 'Value' property to an empty matrix and set the 'Max' and 'Min' properties to satisfy the following condition:
Max - Min > 1
Note that this will also allow the user to select >1 from the listbox. More info .
  10 个评论
Adam Danz
Adam Danz 2018-7-20
You need to set that value either 1) when you are creating the listbox (as in my example) or 2) in the properties menu if you're using GUIDE.
You can also change the 'value' setting any time by using the handle to the listbox.
either
lb.Value = [];
or
set(lb, 'Value', [])

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by