Solved

Detect user selecting item from a combo box list

Posted on 2004-08-25
2
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 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