Shape.ParentChanged Event

 

Occurs when the Parent property value changes.

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

Syntax

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

Remarks

The Parent property must be set to an instance of a ShapeContainer.

For more information about how to handle events, see Handling and Raising Events.

Examples

The following example shows how to respond to the ParentChanged event in an event handler. This example requires that you have an OvalShape control named OvalShape1 on a form.

private void ovalShape1_ParentChanged(object sender, System.EventArgs e)
{
    MessageBox.Show("The shape has been moved to a new container.");
}
Private Sub OvalShape1_ParentChanged() Handles OvalShape1.ParentChanged
    MsgBox("The shape has been moved to a new container.")
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