Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Detect user selecting item from a combo box list

Posted on 2004-08-25
2
Medium Priority
?
222 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 375 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

604 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