How to display button contents vertically in WPF?

I recently installed Visual Studio 2010, and I found that the contents of the sidebar button look upright, as shown below.

Screenshot with vertical text for VS2010

My question is: is there an easy way to achieve this effect in WPF?

+7
source share
2 answers

Very simple, use LayoutTransform and RotateTransform :

 <ToggleButton Content="Members Info" HorizontalAlignment="Right" Click="btn_MembersInfo_Click"> <ToggleButton.LayoutTransform> <RotateTransform Angle="-90" /> </ToggleButton.LayoutTransform> </ToggleButton> 
+15
source

You will need to adjust the height and center of the width

 <Button Content="RotatedButton" Width="200" Height="100"> <Button.RenderTransform> <RotateTransform CenterX="0" CenterY="0" Angle="90" /> </Button.RenderTransform> </Button> 
+4
source

All Articles