2012-04-10 4 views
2

次のコードでは、テキストABCDEはグリッドの先頭から始まり、グリッドの外側に文字を配置します。回転したTextBlockを上に固定する方法は?

グリッドの内側にテキストが残り、最後の文字がグリッドの最上部で終わるようにするにはどうすればよいですか?

<Window x:Class="WpfApplication1.Window1" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     Title="Window1" Height="300" Width="300"> 
    <Grid> 
     <TextBlock Text="ABCDE" > 
       <TextBlock.RenderTransform> 
        <RotateTransform Angle="-90" /> 
       </TextBlock.RenderTransform> 
     </TextBlock> 
    </Grid> 
</Window> 
+1

中に適用されるLayoutTransformを使用します? – Jay

答えて

3

代わりRenderTransform

LayoutTransformのレイアウトパスではなく、レンダーパスあなたは `LayoutTransform`代わりに` RenderTransform`のを使用している場合はどうなりますか

<TextBlock Text="ABCDE" > 
    <TextBlock.LayoutTransform> 
     <RotateTransform Angle="-90" /> 
    </TextBlock.LayoutTransform> 
</TextBlock> 
関連する問題