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

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

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 Handling and Raising 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 void rectangleShape1_EnabledChanged(object sender, System.EventArgs e)
{
    if (rectangleShape1.Enabled == true)
    // Display a crosshair cursor.
    {
        rectangleShape1.Cursor = Cursors.Cross;
    }
}
Private Sub RectangleShape1_EnabledChanged(
  ) Handles RectangleShape1.EnabledChanged

    If RectangleShape1.Enabled = True Then
        ' Display a crosshair cursor.
        RectangleShape1.Cursor = Cursors.Cross
    End If
End Sub

See Also

Shape Class
Microsoft.VisualBasic.PowerPacks Namespace
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)

Return to top