共用方式為


Shape.ParentChanged 事件

發生於 Parent 屬性值變更時。

命名空間:  Microsoft.VisualBasic.PowerPacks
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

'宣告
<BrowsableAttribute(True)> _
Public Event ParentChanged As EventHandler
[BrowsableAttribute(true)]
public event EventHandler ParentChanged
[BrowsableAttribute(true)]
public:
 event EventHandler^ ParentChanged {
    void add (EventHandler^ value);
    void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member ParentChanged : IEvent<EventHandler,
    EventArgs>
JScript 不支援事件。

備註

Parent屬性必須設定執行個體的ShapeContainer

如需如何處理事件的詳細資訊,請參閱使用事件

範例

下列範例顯示如何在事件處理常式中回應 ParentChanged 事件。這個範例要求您必須OvalShape控制項的表單上命名為 OvalShape1。

Private Sub OvalShape1_ParentChanged() Handles OvalShape1.ParentChanged
    MsgBox("The shape has been moved to a new container.")
End Sub
private void ovalShape1_ParentChanged(object sender, System.EventArgs e)
{
    MessageBox.Show("The shape has been moved to a new container.");
}

.NET Framework 安全性

請參閱

參考

Shape 類別

Microsoft.VisualBasic.PowerPacks 命名空間

其他資源

HOW TO:使用 LineShape 控制項繪製線條 (Visual Studio)

HOW TO:使用 OvalShape 和 RectangleShape 控制項繪製圖案 (Visual Studio)

Line 和 Shape 控制項簡介 (Visual Studio)