ToolStripDropDownItem.DropDownOpened 이벤트

정의

열 때 ToolStripDropDown 발생합니다.

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

이벤트 유형

예제

다음 코드 예제에서는 여러 DropDownOpened 컨트롤에 ToolStripDropDownItem 대 한 이벤트를 처리 하는 방법을 보여 줍니다. 이 코드 예제는 클래스에 제공된 더 큰 예제의 ToolStripDropDownItem 일부입니다.

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

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

     Dim item As ToolStripDropDownItem = CType(sender, ToolStripDropDownItem)

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

 End Sub

설명

이 이벤트는 사용자가 드롭다운 항목을 클릭하거나 메서드를 호출 ShowDropDown 할 때 발생합니다. 이 이벤트를 사용하여 .를 동적으로 채울 ToolStripDropDown수 있습니다.

이벤트 처리에 대한 자세한 내용은 이벤트 처리 및 발생시키기를 참조하십시오.

적용 대상