Solved

Detect user selecting item from a combo box list

Posted on 2004-08-25
2
219 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.Net error: An exception occurred during a WebClient request 6 42
Import Data from Multiple Text Files in Excel 12 86
Visual Studios 1 89
MailAddress in vb 4 36
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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