How to make a vertical progress bar?

淺唱寂寞╮ 提交于 2019-12-21 20:22:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!