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 2002. There is a drop-down event, but how to detect when the user selects an item?


Who is Participating?
ramesh12Connect With a Mentor Commented:
use dropdown selectionchanged event

and then use like this

dropdownlist.selecteditem.value for value
dropdownlist.selecteditem.text for selected text
rdavis101Author Commented:
Seems to interfere with my Autocomplete code (see below, this code from somewhere).  When the autocomplete completes, the SelectedValueChanged or SelectedIndexChanged Events fire.

            If Char.IsControl(e.KeyChar) Then Return

            With Me
                Dim stTextToFind As String = .Text.Substring(0, .SelectionStart)
                Dim Index As Integer = .FindStringExact(stTextToFind)

                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
        End Try
However, it looks like the SelectionChangeCommitted event does the trick, and doesn't interfere with the Autocomplete code.


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.