ToolStripDropDownItem.DropDownClosed 事件

定义

ToolStripDropDown 关闭时发生。

public:
 event EventHandler ^ DropDownClosed;
public event EventHandler DropDownClosed;
public event EventHandler? DropDownClosed;
member this.DropDownClosed : EventHandler 
Public Custom Event DropDownClosed As EventHandler 

事件类型

示例

下面的代码示例演示如何处理 DropDownClosed 多个 ToolStripDropDownItem 控件的 事件。 此代码示例是为 ToolStripDropDownItem 类提供的一个更大示例的一部分。

// This method handles the DropDownClosed event from a 
// ToolStripDropDownItem. It displays the value of the 
// item's Text property in the form's StatusStrip control.
void toolStripDropDownItem_DropDownClosed(object sender, EventArgs e)
{
    ToolStripDropDownItem item = sender as ToolStripDropDownItem;

    string msg = String.Format("Item closed: {0}", item.Text);
    this.toolStripStatusLabel1.Text = msg;
}
' This method handles the DropDownClosed event from a 
' ToolStripDropDownItem. It displays the value of the 
' item's Text property in the form's StatusStrip control.
 Private Sub toolStripDropDownItem_DropDownClosed(ByVal sender As Object, ByVal e As EventArgs)

     Dim item As ToolStripDropDownItem = CType(sender, ToolStripDropDownItem)

     Dim msg As String = String.Format("Item closed: {0}", item.Text)
     Me.toolStripStatusLabel1.Text = msg

 End Sub

注解

有关处理事件的详细信息,请参阅 处理和引发事件

适用于