D
docw
SelectionChangeCommitted event fires twice
Hi,
Please have a look at the following ComboBox behavior.
With the code below, if you click in the dropdown list with the mouse
to select an item , everything is fine.
But if you use the Enter key to select in the dropdown list, the
SelectionChangeCommitted event is fired twice.
How can I cancel the second event firing ?
Thanks
ML
'#### BEGIN CODE ##################
Private Sub FormTest_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
ComboBox1.Items.Add("My item 1")
ComboBox1.Items.Add("My item 2")
ComboBox1.Items.Add("My item 3")
End Sub
Private Sub ComboBox1_SelectionChangeCommitted(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectionChangeCommitted
MsgBox("test")
End Sub
'#### END CODE ##################
Hi,
Please have a look at the following ComboBox behavior.
With the code below, if you click in the dropdown list with the mouse
to select an item , everything is fine.
But if you use the Enter key to select in the dropdown list, the
SelectionChangeCommitted event is fired twice.
How can I cancel the second event firing ?
Thanks
ML
'#### BEGIN CODE ##################
Private Sub FormTest_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
ComboBox1.Items.Add("My item 1")
ComboBox1.Items.Add("My item 2")
ComboBox1.Items.Add("My item 3")
End Sub
Private Sub ComboBox1_SelectionChangeCommitted(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectionChangeCommitted
MsgBox("test")
End Sub
'#### END CODE ##################