Dynamically Resizing Visual Elements with ScaleTransform

ScaleTransform enables you to dynamically resize a control. The following code demonstrates how a ListBox can be scaled to different dimensions:

<ListBox Name="ScaleListBox" Grid.Row="0" Grid.Column="1"         Style="{StaticResource ListStyle}">    <ListBox.RenderTransform>        <ScaleTransform CenterX="0" CenterY="0" ScaleX="0.6" ScaleY="0.6"/>    </ListBox.RenderTransform></ListBox>

Notice how scaling is expressed in percentage with the ScaleX and ScaleY properties. A value of 0.6 means that the control is scaled to 60% of its original dimensions. A value of 1 means 100% (that is, the original size), whereas a value bigger than 1 enlarges the visual element. ...

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.