With the following code the text ABCDE starts from the top of the grid and places the letters outside the grid.
How can I make it so the text stays inside the grid and the last letter ends at the top of the grid?
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<TextBlock Text="ABCDE" >
<TextBlock.RenderTransform>
<RotateTransform Angle="-90" />
</TextBlock.RenderTransform>
</TextBlock>
</Grid>
</Window>
Use a
LayoutTransforminstead of aRenderTransformLayoutTransformis applied during the layout pass, not the render pass