I have a grid in a WPF window, and that contains a label in its first column. I have applied a SkewTransform for the label. If I reduce the column width the label is displayed half
alt text http://freephotoupload.net/images/673_Lable.jpg
I’m expecting it to display Prashant, my main aim is to reduce extra white space next to the label
XAML Code
<Grid ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="146.334" />
<ColumnDefinition Width="94.666" />
</Grid.ColumnDefinitions>
<Label Margin="0" VerticalAlignment="Center" Width="Auto" Name="label1" RenderTransformOrigin="0.5,0.5" Content="Prashant">
<Label.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="-90"/>
<TranslateTransform X="0" Y="0"/>
</TransformGroup>
</Label.RenderTransform>
</Label>
</Grid>
any suggestions Please….
Do a
LayoutTransforminstead of aRenderTransform.In WPF,
RenderTransformsare performed on controls after they have been laid out.In your case, the
Labelis being cut short by the width of the column, first; then, the RenderTransform is applied (the rotate is the only one that does anything), resulting it the odd-lookingLabel.A
LayoutTransformis done before a control is laid out.Like this: