问题
I'm trying to create a ProgressBar
that is vertical rather than horizontal, I've tried changing the angle of the ProgressBar
so it's vertical rather than horizontal, heres my code:
<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>
However, the progress bar itself is from side to side rather than top to bottom. I've tried changing the FlowDirection
but that only gives you the 2 options of LeftToRight
or RightToLeft
Does anyone have any ideas/suggestions?
回答1:
You are probably looking for ProgressBar.Orientation Property
Gets or sets the orientation of a ProgressBar: horizontal or vertical.
回答2:
<ProgressBar RenderTransformOrigin="0.5,0.5" >
<ProgressBar.RenderTransform>
<CompositeTransform Rotation="90"/>
</ProgressBar.RenderTransform>
</ProgressBar>
This works just fine for me.
回答3:
Orientation="Vertical"
in the ProgressBar
tag and then in the rest of your code.
来源:https://stackoverflow.com/questions/33416356/how-to-make-a-vertical-progress-bar