ToolStripDropDownClosingEventArgs クラス
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
Closing イベントのデータを提供します。
public ref class ToolStripDropDownClosingEventArgs : System::ComponentModel::CancelEventArgs
public class ToolStripDropDownClosingEventArgs : System.ComponentModel.CancelEventArgs
type ToolStripDropDownClosingEventArgs = class
inherit CancelEventArgs
Public Class ToolStripDropDownClosingEventArgs
Inherits CancelEventArgs
- 継承
次のコード例では、この型の使用方法を示します。 この例では、イベント ハンドラーがイベントの Closing 発生を報告します。 このレポートは、イベントが発生したタイミングを知るのに役立ち、デバッグに役立ちます。 複数のイベントまたは頻繁に発生するイベントを報告するには、 を Console.WriteLine に置き換えるかShow、複数行TextBoxにメッセージを追加することを検討してください。
コード例を実行するには、 という名前ToolStripDropDown1
の型ToolStripDropDownのインスタンスを含むプロジェクトに貼り付けます。 次に、イベント ハンドラーが イベントに関連付けられていることを確認します Closing 。
private void ToolStripDropDown1_Closing(Object sender, ToolStripDropDownClosingEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "CloseReason", e.CloseReason );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Cancel", e.Cancel );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "Closing Event" );
}
Private Sub ToolStripDropDown1_Closing(sender as Object, e as ToolStripDropDownClosingEventArgs) _
Handles ToolStripDropDown1.Closing
Dim messageBoxVB as New System.Text.StringBuilder()
messageBoxVB.AppendFormat("{0} = {1}", "CloseReason", e.CloseReason)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "Cancel", e.Cancel)
messageBoxVB.AppendLine()
MessageBox.Show(messageBoxVB.ToString(),"Closing Event")
End Sub
クラスのデータを ToolStripDropDownClosingEventArgs 使用して、ユーザーがドロップダウン リストを閉じたときに、リストを閉じる前に実行するアクションを決定します。
Tool |
閉じられる理由を指定して、ToolStripDropDownClosingEventArgs クラスの新しいインスタンスを初期化します。 |
Cancel |
イベントをキャンセルするかどうかを示す値を取得または設定します。 (継承元 CancelEventArgs) |
Close |
ToolStripDropDown が閉じようとしている理由を取得します。 |
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
Get |
既定のハッシュ関数として機能します。 (継承元 Object) |
Get |
現在のインスタンスの Type を取得します。 (継承元 Object) |
Memberwise |
現在の Object の簡易コピーを作成します。 (継承元 Object) |
To |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
製品 | バージョン |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。