필터 지우기
필터 지우기

how to put only one item in the listbox

조회 수: 2 (최근 30일)
Luca Re
Luca Re 2023년 11월 12일
댓글: Walter Roberson 2023년 11월 13일
I want to fill the space of the box only with one element from the list I tried making the font bigger but it doesn't work bold type works instead
string(Function_Categorical_Struct("TypeEquity"))
sst=string(Function_Categorical_Struct("TypeEquity"));
app.ChoiseEquityListBox.Items=sst;
app.ChoiseEquityListBox.Value=sst(1);
app.ChoiseEquityListBox.FontWeight='bold';

채택된 답변

Walter Roberson
Walter Roberson 2023년 11월 13일
Are you trying to create a list that only has a single element? Such as
app.ChoiseEquityListBox.Items = {'Filtered'};
app.ChoiseEquityListBox.Value = app.ChoiseEquityListBox.Value{1};
Or do you have a listbox with multiple elements but you want to arrange that when the listbox is displayed normally, that only the current value is visibile?
If you want only one element to be visible ... then use a drop box instead of a listbox.
But if there is specific reason to make it a uilistbox, then set the last component if its Position property to roughly 20.
  댓글 수: 2
Luca Re
Luca Re 2023년 11월 13일
thank you but
In documentation i read:
i see "Position Location and size of list box
[100 100 100 74] (default) | [left bottom width height]"
what do you mean with :
you write:"But if there is specific reason to make it a uilistbox, then set the last component if its Position property to roughly 20."
Walter Roberson
Walter Roberson 2023년 11월 13일
The last component is height. I am suggesting that if you use default font size that a height of 20 looks good to frame a single line of choice.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by