Hello
I want to rotate a grid by, for egxample, 45 degrees. How it could be done programically?
Thanks in advance.
you can do something like this(g1 is the name of the grid)
g1.RenderTransform = rt;
To make it rotate 45 degrees around the center you would just do:
myGrid.LayoutTransform = new RotateTransform(45, myGrid.Width / 2, myGrid.Height / 2);
For more details, check out this section of the SDK.
HTH,Drew
Drew Marsh wrote: myGrid.LayoutTransform = new RotateTransform(45, myGrid.Width / 2, myGrid.Height / 2);
the above will work if Width and Height are specified, if they are not specified, you have to use ActualWidth, ActualHeight
lee d wrote: Drew Marsh wrote: myGrid.LayoutTransform = new RotateTransform(45, myGrid.Width / 2, myGrid.Height / 2); the above will work if Width and Height are specified, if they are not specified, you have to use ActualWidth, ActualHeight
Yes indeed. Thank you for clarifying that.
Cheers,Drew