次の方法で共有


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 名前空間

その他の技術情報

方法 : LineShape コントロールを使用して線を描画する (Visual Studio)

方法 : OvalShape コントロールおよび RectangleShape コントロールを使用して図形を描画する (Visual Studio)

ライン コントロールとシェイプ コントロールの概要 (Visual Studio)