Solved

Detect user selecting item from a combo box list

Posted on 2004-08-25
2
215 Views
Last Modified: 2010-04-23
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
0
Comment
Question by:rdavis101
2 Comments
 
LVL 7

Accepted Solution

by:
ramesh12 earned 125 total points
ID: 11897738
use dropdown selectionchanged event

and then use like this

dropdownlist.selecteditem.value for value
dropdownlist.selecteditem.text for selected text
0
 

Author Comment

by:rdavis101
ID: 11898005
Seems to interfere with my Autocomplete code (see below, this code from www.CodeProject.com somewhere).  When the autocomplete completes, the SelectedValueChanged or SelectedIndexChanged Events fire.

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

Roger




0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now