开发者

Textblock take same horizontal space even apply RotateTransform

I am apply RotateTransform on a textblock so that it display text vertically rather than horizontally but it take same space horizontally when it is not transfored. Please suggest solution to remove this hozitonally sapce.

<Border  BorderBrush="#888888" BorderThickness="0,0,2,0">
    <TextBlock FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold" FontSize="15" Text="Menu" >
        <TextBloc开发者_如何学Ck.RenderTransform>
            <RotateTransform Angle="270" />
        </TextBlock.RenderTransform>
     </TextBlock>
</Border>


Use LayoutTranform instead of RenderTransform

<Border  BorderBrush="#888888" BorderThickness="0,0,2,0">
    <TextBlock FontFamily="Arial" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold" FontSize="15" Text="Menu" >
        <TextBlock.LayoutTransform>
            <RotateTransform Angle="270" />
        </TextBlock.LayoutTransform>
     </TextBlock>
</Border>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜