Compartir a través de


Shape.EnabledChanged Event

Occurs when the Enabled property value has changed.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

'Declaration
<BrowsableAttribute(True)> _
Public Event EnabledChanged As EventHandler
[BrowsableAttribute(true)]
public event EventHandler EnabledChanged
[BrowsableAttribute(true)]
public:
 event EventHandler^ EnabledChanged {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member EnabledChanged : IEvent<EventHandler,
    EventArgs>
JScript does not support events.

Remarks

This event is raised if the Enabled 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 changes the Cursor when the Enabled property is changed to true. This example requires that you have a RectangleShape control named RectangleShape1 on a form.

Private Sub RectangleShape1_EnabledChanged(
  ) Handles RectangleShape1.EnabledChanged

    If RectangleShape1.Enabled = True Then 
        ' Display a crosshair cursor.
        RectangleShape1.Cursor = Cursors.Cross
    End If 
End Sub
private void rectangleShape1_EnabledChanged(object sender, System.EventArgs e)
{
    if (rectangleShape1.Enabled == true)
    // Display a crosshair cursor.
    {
        rectangleShape1.Cursor = Cursors.Cross;
    }
}

.NET Framework Security

See Also

Reference

Shape Class

Microsoft.VisualBasic.PowerPacks Namespace

Other Resources

How to: Draw Lines with the LineShape Control (Visual Studio)

How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)

Introduction to the Line and Shape Controls (Visual Studio)