2

次のコードでは、テキスト ABCDE がグリッドの上部から開始され、文字がグリッドの外に配置されます。

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

<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>
4

1 に答える 1

3

a のLayoutTransform代わりに a を使用するRenderTransform

LayoutTransformレンダー パスではなく、レイアウト パス中に適用されます。

<TextBlock Text="ABCDE"  >
    <TextBlock.LayoutTransform>
        <RotateTransform Angle="-90" />
    </TextBlock.LayoutTransform>
</TextBlock>
于 2012-04-10T18:14:07.563 に答える