Share via


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

'Declaration
<BrowsableAttribute(True)> _
Public Event VisibleChanged As EventHandler
'Usage
Dim instance As Shape 
Dim handler As EventHandler 

AddHandler instance.VisibleChanged, handler
[BrowsableAttribute(true)]
public event EventHandler VisibleChanged
[BrowsableAttribute(true)]
public:
 event EventHandler^ VisibleChanged {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
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(ByVal sender As Object, _
 ByVal e As System.EventArgs) 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

Shape Members

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)