SimpleShape.BackColorChanged Event

 

Occurs when the BackColor property of the shape is changed.

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

Syntax

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

Remarks

This event is raised if the BackColor 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 BackColorChanged event in an event handler. This example requires that you have a RectangleShape control named RectangleShape1 on a form.

private void rectangleShape1_BackColorChanged(object sender, System.EventArgs e)
{
    // The BackStyle must be Opaque or the BackColor has no effect.
    if (rectangleShape1.BackStyle == BackStyle.Transparent)
    {
        rectangleShape1.BackStyle = BackStyle.Opaque;
    }
}
Private Sub RectangleShape1_BackColorChanged(
  ) Handles RectangleShape1.BackColorChanged

    ' The BackStyle must be Opaque or the BackColor has no effect.
    If RectangleShape1.BackStyle = BackStyle.Transparent Then
        RectangleShape1.BackStyle = BackStyle.Opaque
    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