Compartilhar via


ComboBox.DropDownOpened Evento

Definição

Ocorre quando a lista suspensa da caixa de combinação se abre.

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

Tipo de evento

Exemplos

O exemplo a seguir mostra como atribuir manipuladores de eventos e manipular os DropDownOpened eventos e DropDownClosed .

<ComboBox Name="cb" StaysOpenOnEdit="true" IsEditable="true" DropDownOpened="OnDropDownOpened" 
        DropDownClosed="OnDropDownClosed">
void OnDropDownOpened(object sender, EventArgs e)
{
    if (cb.IsDropDownOpen == true)
    {
        cb.Text = "Combo box opened";
    }
}

void OnDropDownClosed(object sender, EventArgs e)
{
    if (cb.IsDropDownOpen == false)
    {
        cb.Text = "Combo box closed";
    }
}
Private Sub OnDropDownOpened(ByVal Sender As Object, ByVal e As EventArgs)

    If (cb.IsDropDownOpen = True) Then
        cb.Text = "Combo box opened"
    End If

End Sub

Private Sub OnDropDownClosed(ByVal Sender As Object, ByVal e As EventArgs)

    If (cb.IsDropDownOpen = False) Then
        cb.Text = "Combo box closed"
    End If

End Sub

Aplica-se a