0

I have an WPF expander, and I have placed in its header a TextBlock. Now I am trying to put TextBlock text in vertical orientation. For example, if the text is "Settings" I want to put it in the following way:

S
E
T
T
I
N
G
S

Expander xaml code:

<Expander Grid.Row="0" 
          Grid.RowSpan="2"
          Grid.Column="1" 
          Width="25"
          ExpandDirection="Left">
    <Expander.Header>
        <TextBlock Text="Settings">
            <TextBlock.LayoutTransform>
                <RotateTransform Angle="-90"/>
            </TextBlock.LayoutTransform>
        </TextBlock>
    </Expander.Header>
</Expander>
Willy
  • 9,848
  • 22
  • 141
  • 284

1 Answers1

0

not looking good but your current code result looks good but still if you want why don't you try this simple

<Expander Grid.Row="0" 
      Grid.RowSpan="2"
      Grid.Column="1" 
      Width="25"
      ExpandDirection="Left">
        <Expander.Header>
            <TextBlock TextAlignment="Center">
                <Run Text="S"/>
                <LineBreak/>
                <Run Text="E"/>
                <LineBreak/>
                <Run Text="T"/>
                <LineBreak/>
                <Run Text="T"/>
                <LineBreak/>
                <Run Text="I"/>
                <LineBreak/>
                <Run Text="N"/>
                <LineBreak/>
                <Run Text="G"/>
                <LineBreak/>
                <Run Text="S"/>
            </TextBlock>
        </Expander.Header>
    </Expander>
Shubham Sahu
  • 1,963
  • 1
  • 17
  • 34