Shape.VisibleChanged Event

 

Occurs when the Visible property value changes.

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

Syntax

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

Remarks

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

private void ovalShape1_VisibleChanged(object sender, System.EventArgs e)
{
    // Switch between the oval and rectangle shapes.
    if (ovalShape1.Visible == false)
    {
        rectangleShape1.Visible = true;
    }
    else
    {
        rectangleShape1.Visible = false;
    }
}
Private Sub OvalShape1_VisibleChanged() Handles OvalShape1.VisibleChanged
    ' Switch between the oval and rectangle shapes.
    If OvalShape1.Visible = False Then
        RectangleShape1.Visible = True
    Else
        RectangleShape1.Visible = False
    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