如何制作垂直进度条?
How to make a vertical progress bar?
我正在尝试创建一个垂直而非水平的 ProgressBar
,我已尝试更改 ProgressBar
的角度使其垂直而非水平,这是我的代码:
<ProgressBar Maximum="100" Value="20" Height="30" Width="5" >
<ProgressBar.Background>
<SolidColorBrush Color="White" Opacity="0.15999999642372131"/>
</ProgressBar.Background>
<ProgressBar.RenderTransform>
<RotateTransform Angle="0" CenterX="0" CenterY="0"/>
</ProgressBar.RenderTransform>
</ProgressBar>
但是,进度条本身是从一侧到另一侧而不是从上到下。我试过更改 FlowDirection
但这只会给你 LeftToRight
或 RightToLeft
的 2 个选项
有人有ideas/suggestions吗?
您可能正在寻找 ProgressBar.Orientation Property
Gets or sets the orientation of a ProgressBar: horizontal or vertical.
Orientation="Vertical"
在 ProgressBar
标记中,然后在其余代码中。
<ProgressBar RenderTransformOrigin="0.5,0.5" >
<ProgressBar.RenderTransform>
<CompositeTransform Rotation="90"/>
</ProgressBar.RenderTransform>
</ProgressBar>
这对我来说很好。
我正在尝试创建一个垂直而非水平的 ProgressBar
,我已尝试更改 ProgressBar
的角度使其垂直而非水平,这是我的代码:
<ProgressBar Maximum="100" Value="20" Height="30" Width="5" >
<ProgressBar.Background>
<SolidColorBrush Color="White" Opacity="0.15999999642372131"/>
</ProgressBar.Background>
<ProgressBar.RenderTransform>
<RotateTransform Angle="0" CenterX="0" CenterY="0"/>
</ProgressBar.RenderTransform>
</ProgressBar>
但是,进度条本身是从一侧到另一侧而不是从上到下。我试过更改 FlowDirection
但这只会给你 LeftToRight
或 RightToLeft
有人有ideas/suggestions吗?
您可能正在寻找 ProgressBar.Orientation Property
Gets or sets the orientation of a ProgressBar: horizontal or vertical.
Orientation="Vertical"
在 ProgressBar
标记中,然后在其余代码中。
<ProgressBar RenderTransformOrigin="0.5,0.5" >
<ProgressBar.RenderTransform>
<CompositeTransform Rotation="90"/>
</ProgressBar.RenderTransform>
</ProgressBar>
这对我来说很好。