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)

Syntax

[BrowsableAttribute(true)]
public event EventHandler ClientSizeChanged
public:
[BrowsableAttribute(true)]
event EventHandler^ ClientSizeChanged {
    void add(EventHandler^ value);
    void remove(EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member ClientSizeChanged : IEvent<EventHandler,
    EventArgs>
<BrowsableAttribute(True)>
Public Event ClientSizeChanged As EventHandler

Remarks

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 Handling and Raising Events.

Examples

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;
    }
}
Private Sub RectangleShape1_ClientSizeChanged(
  ) Handles RectangleShape1.ClientSizeChanged

    ' Restrict the shape to a certain width range.
    If RectangleShape1.Width > 300 Then
        RectangleShape1.Width = 300
    ElseIf RectangleShape1.Width < 50 Then
        RectangleShape1.Width = 50
    End If
End Sub

See Also

SimpleShape Class
Microsoft.VisualBasic.PowerPacks Namespace
Introduction to the Line and Shape Controls (Visual Studio)
How to: Draw Lines with the LineShape Control (Visual Studio)
How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)

Return to top