Fill Combo Box as text is being entered in a Text Box

Posted on 2006-04-13
Last Modified: 2010-04-17
I have a Text box and a Combo Box on a form.  When the user enters any part of a last name, the combo box gets populated. I want to change this to as the user enters each character in the Text Box, the combo box gets populated as each character is entered in the text box.  I've used the Keypress event but doesn't do what I want.
Question by:RFGNaper
    LVL 19

    Accepted Solution

    You need to use the Key_Down event:

    void yourtextBox_KeyDown(object sender, KeyEventArgs e)
                switch (e.KeyCode)
                    case Keys.Enter:
                           // your code here

    LVL 11

    Expert Comment

    Isn't there some event like onChange or something for example?

    Featured Post

    Course: Create Mobile App Prototypes with Adobe XD

    This is a project-based course: we go through all the steps of creating a prototype from start to finish, using all the tools and features currently available in Adobe XD. You can complete the course in less than a day, plus all project files and fonts are included.

    Join & Write a Comment

    Suggested Solutions

    I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
    This is about my first experience with programming Arduino.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    729 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

    18 Experts available now in Live!

    Get 1:1 Help Now