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

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

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

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

.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)