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

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

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

.NET Framework Security

See Also

Reference

SimpleShape Class

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)