changing uislider position by script

조회 수: 11 (최근 30일)
Borshin Chang
Borshin Chang 2020년 6월 19일
댓글: Borshin Chang 2020년 6월 19일
Hi everyone,
I'm new in using matlab gui,
I found that the function "uislider" can only show horizontal slider no matter what position I tryed.
Is there any ways to change slider to vertical?
Here is a simple script below.
clc;
clear;
close all;
fig = uifigure('Position',[100 100 350 275]);
cg=0;
sld = uislider(fig,...
'Position',[ 100 100 100 100],...
'ValueChangingFcn',@(sld, event) sliderMoving(event,cg));
  댓글 수: 1
Borshin Chang
Borshin Chang 2020년 6월 19일
Thanks everyone,
I though I solved it.
When object [sld] is created, u can change its attribute like
sld.Orientation = 'vertical';
clc;
clear;
close all;
fig = uifigure('Position',[100 100 350 275]);
cg=0;
sld = uislider(fig,...
'Position',[ 100 100 100 100],...
'ValueChangingFcn',@(sld, event) sliderMoving(event,cg));
sld.Orientation = 'vertical';

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

답변 (1개)

Tommy
Tommy 2020년 6월 19일
sld = uislider(fig,...
'Orientation', 'vertical',...
'Position',[ 100 100 3 100],...
'ValueChangingFcn',@(sld, event) sliderMoving(event,cg));

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by