开发者

Textblock take same horizontal space even apply RotateTransform

开发者 https://www.devze.com 2023-03-08 09:13 出处:网络
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 t

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

精彩评论

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