簡體   English   中英

wpf progressbar.RenderTransform在設計器中的窗口外部

[英]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處理圖形組件的方式是:

  1. LayoutTransform
  2. 測量
  3. 安排
  4. 的RenderTransform
  5. 給予

聽起來您想在測量和布置組件之前而不是之后進行轉換。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM