필터 지우기
필터 지우기

remove slider from Listbox

조회 수: 4 (최근 30일)
Houssem medini
Houssem medini 2011년 5월 4일
Hi,
Is it possible to remove the slider from a listbox?
if yes, could you help me with to do so?
Thanks
Houssem

채택된 답변

Matt Fig
Matt Fig 2011년 5월 4일
As Walter says, this cannot be done in MATLAB. I cannot really think of a reason why you would want to do this, but if you have one here is an approach that might work for you. Note that this doesn't get rid of the slider, but hides it from the user.
function [S] = list_hide()
S.fh = figure('units','pixels',...
'position',[500 500 200 100],...
'menubar','none',...
'name','Hide_list',...
'numbertitle','off',...
'resize','off');
S.pb = uicontrol('style','list',...
'busyaction','cancel',...
'units','pix',...
'pos',[10 10 200 80],...
'string',{'One';'two';'three';'four';'five'});
uicontrol('style','frame',...
'units','pix',...
'posit',[190 10 30 80],...
'backgroundcol',get(S.fh,'color'),...
'foregroundcol',get(S.fh,'color'));
  댓글 수: 5
Matt Fig
Matt Fig 2011년 5월 4일
@Walter, that's what I meant by "in MATLAB." Thanks for bringing that out explicitly...
Matt Fig
Matt Fig 2011년 5월 4일
@Walter, I think Oleg meant that the GUI would be a patchwork of uicontrols, not to use an actual patch object...

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

추가 답변 (2개)

Jan
Jan 2011년 5월 4일
  댓글 수: 1
Houssem medini
Houssem medini 2011년 5월 5일
yes I did.
Thanks

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


Walter Roberson
Walter Roberson 2011년 5월 4일
The slider is automatic if there are more entries than there is space available to display them.
What would you prefer to have happen in that circumstance?
If you only want to see one entry at a time and mouse through them, then a pop-up box would be more appropriate than a listbox, unless you need to be able to select multiple values.
  댓글 수: 1
Houssem medini
Houssem medini 2011년 5월 5일
yes I want to select multiple values and I am sure that the entries will not exceed the space allocated.
In the listbox, the slider is allways displayed, either needed or not.
thank you

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

카테고리

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