This topic has not yet been rated - Rate this topic

SimpleShape.ClientSizeChanged Event

Occurs when the ClientSize property of a shape is changed.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
[BrowsableAttribute(true)]
public event EventHandler ClientSizeChanged

This event is raised if the ClientSize property is changed by either a programmatic modification or user interaction.

For more information about how to handle events, see Consuming Events.

The following example shows how to respond to the ClientSizeChanged event in an event handler. This example requires that you have a RectangleShape control named RectangleShape1 on a form.

private void rectangleShape1_ClientSizeChanged(object sender, System.EventArgs e)
{
    // Restrict the shape to a certain width range. 
    if (rectangleShape1.Width > 300)
    {
        rectangleShape1.Width = 300;
    }
    else if (rectangleShape1.Width < 50)
    {
        rectangleShape1.Width = 50;
    }
}
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.