rdavis101
asked on
Detect user selecting item from a combo box list
When a combobox is dropped down, a list is displayed. When the user clicks on one of the list items, it's selected, the box is no longer dropped down, and the text changes to the selected item.
I would like to detect the user selecting a list item. Using VB.net 2002. There is a drop-down event, but how to detect when the user selects an item?
Thanks.
Roger
I would like to detect the user selecting a list item. Using VB.net 2002. There is a drop-down event, but how to detect when the user selects an item?
Thanks.
Roger
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Try
If Char.IsControl(e.KeyChar) Then Return
With Me
Dim stTextToFind As String = .Text.Substring(0, .SelectionStart)
Dim Index As Integer = .FindStringExact(stTextToF
If Index = -1 Then Index = .FindString(stTextToFind)
If Index = -1 Then Return
.SelectedIndex = Index
.SelectionStart = stTextToFind.Length
.SelectionLength = .Text.Length - .SelectionStart
e.Handled = True
End With
Catch
End Try
----------
However, it looks like the SelectionChangeCommitted event does the trick, and doesn't interfere with the Autocomplete code.
Roger