ComboBox.DropDownClosed Event
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the drop-down list of the combo box closes.
public:
event EventHandler ^ DropDownClosed;
C#
public event EventHandler DropDownClosed;
member this.DropDownClosed : EventHandler
Public Custom Event DropDownClosed As EventHandler
The following example shows how to assign event handlers and how to handle the DropDownOpened and DropDownClosed events.
XAML
<ComboBox Name="cb" StaysOpenOnEdit="true" IsEditable="true" DropDownOpened="OnDropDownOpened"
DropDownClosed="OnDropDownClosed">
C#
void OnDropDownOpened(object sender, EventArgs e)
{
if (cb.IsDropDownOpen)
{
cb.Text = "Combo box opened";
}
}
void OnDropDownClosed(object sender, EventArgs e)
{
if (!cb.IsDropDownOpen)
{
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
Производ | Верзије |
---|---|
.NET Framework | 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 |
Сарађујте са нама на GitHub-у
Извор овог садржаја можете пронаћи на платформи GitHub, где можете и да креирате и прегледате проблеме и захтеве за повлачењем. Више информација потражите у нашем водичу за сараднике.
.NET повратне информације
.NET је пројекат отвореног кода. Изаберите везу да бисте обезбедили повратне информације: