Vertical Text in Wpf TextBlock

后端 未结 14 1739
星月不相逢
星月不相逢 2020-11-29 04:14

Is it possible to display the text in a TextBlock vertically so that all letters are stacked upon each other (not rotated with LayoutTransform)?

相关标签:
14条回答
  • Just in case anybody still comes across this post... here is a simple 100% xaml solution.

        <TabControl TabStripPlacement="Left">
            <TabItem Header="Tab 1">
                <TabItem.LayoutTransform>
                    <RotateTransform Angle="-90"></RotateTransform>      
                </TabItem.LayoutTransform>
                <TextBlock> Some Text for tab 1</TextBlock>
            </TabItem>
            <TabItem Header="Tab 2">
                <TabItem.LayoutTransform>
                    <RotateTransform Angle="-90"></RotateTransform>
                </TabItem.LayoutTransform>
                <TextBlock> Some Text for tab 2</TextBlock>
            </TabItem>
        </TabControl>
    
    0 讨论(0)
  • 2020-11-29 04:42

    Just use a simple LayoutTransform..

    <Label Grid.Column="0" Content="Your Text Here" HorizontalContentAlignment="Center">
      <Label.LayoutTransform>
        <TransformGroup>
            <RotateTransform Angle="90" />
            <ScaleTransform ScaleX="-1" ScaleY="-1"/>
        </TransformGroup>
      </Label.LayoutTransform>
    </Label>
    
    0 讨论(0)
提交回复
热议问题