[英]wpf progressbar.RenderTransform outside of window in designer
當我將180度變換應用於進度欄時,它不在窗口之外。 這就是設計器中的外觀。 http://i.imgur.com/mZfJHXL.jpg
我如何讓它在窗口內移動。
這是我的代碼:
<Window x:Class="game.Player2Screen"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Player2Screen" Height="298" Width="310">
<ProgressBar Name="ProgressBarTimer" Orientation="Vertical" Foreground="Blue" Background="Black" MouseLeftButtonDown="ProgressBarTimer_MouseLeftButtonDown"
Value="0" HorizontalAlignment="Center" Maximum="100" VerticalAlignment="Top" Height="250" Width="265" >
<ProgressBar.RenderTransform>
<RotateTransform Angle="180"/>
</ProgressBar.RenderTransform>
</ProgressBar>
</Window>
您需要指定渲染變換原點。
看到這篇MSDN文章
也許您想使用LayoutTransform
而不是RenderTransform
。
WPF處理圖形組件的方式是:
聽起來您想在測量和布置組件之前而不是之后進行轉換。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.