Rotating Visual Elements with RotateTransform

RotateTransform is a transformation that enables you to rotate a visual element for the specified number of degrees and at the specified position. The following code adds a ListBox in the upper-left cell, and it is rotated 180°:

<ListBox Name="RotateListBox" Grid.Row="0" Grid.Column="0"         Style="{StaticResource ListStyle}">    <ListBox.RenderTransform>        <RotateTransform Angle="180" CenterX="80" CenterY="80"/>    </ListBox.RenderTransform></ListBox>

Notice how the Angle property specifies the degrees, whereas CenterX and CenterY represent the position of rotation. In the preceding example, the rotation comes in at the center of the ListBox (both values are ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.