Hi, Im trying to find out how many items are listed in my listbox, I've tried:
lc=get(handles.listbox1, 'count')
But get the following error
Error using hg.uicontrol/get
The name 'count' is not an accessible property for an instance of class 'uicontrol'.

 採用された回答

Adam
Adam 2014 年 9 月 15 日
編集済み: Adam 2014 年 9 月 15 日

0 投票

str = get( handles.listbox1, 'String' )
lc = numel( str );
If you want to see all the properties of a UI handle object such as a listbox you can just type:
get( handles.listbox1 )
and it will display all the properties in the command window. You can often use that as a way to work out what property you need.

1 件のコメント

Jason
Jason 2014 年 9 月 15 日
perfect, thanks

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeApp Building についてさらに検索

質問済み:

2014 年 9 月 15 日

コメント済み:

2014 年 9 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by