مشاركة عبر


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 ClientSizeChanged As EventHandler
'الاستخدام
Dim instance As SimpleShape
Dim handler As EventHandler

AddHandler instance.ClientSizeChanged, handler
[BrowsableAttribute(true)]
public event EventHandler ClientSizeChanged
[BrowsableAttribute(true)]
public:
 event EventHandler^ ClientSizeChanged {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member ClientSizeChanged : IEvent<EventHandler,
    EventArgs>
JScript does not support events.

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 Consuming 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 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
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;
    }
}

.NET Framework Security

See Also

Reference

SimpleShape Class

SimpleShape Members

Microsoft.VisualBasic.PowerPacks Namespace

Other Resources

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)