Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8384515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:25:24+00:00 2026-06-09T17:25:24+00:00

My problem is similar to this one: How can I dynamically change auto complete

  • 0

My problem is similar to this one: How can I dynamically change auto complete entries in a C# combobox or textbox?
But I still don’t find solution.

The problem briefly:

I have an ComboBox and a large number of records to show in it. When user starts typing I want to load records that starts with input text and offer the user for autocomplete.
As described in the topic above I can’t load them on сomboBox_TextChanged because I always overwrite the previous results and never see them.

Can I implement this using only ComboBox? (not TextBox or ListBox)

I use this settings:

сomboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
сomboBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:25:25+00:00Added an answer on June 9, 2026 at 5:25 pm

    Here is my final solution. It works fine with a large amount of data. I use Timer to make sure the user want find current value. It looks like complex but it doesn’t.
    Thanks to Max Lambertini for the idea.

            private bool _canUpdate = true; 
    
            private bool _needUpdate = false;       
    
            //If text has been changed then start timer
            //If the user doesn't change text while the timer runs then start search
            private void combobox1_TextChanged(object sender, EventArgs e)
            {
                if (_needUpdate)
                {
                    if (_canUpdate)
                    {
                        _canUpdate = false;
                        UpdateData();                   
                    }
                    else
                    {
                        RestartTimer();
                    }
                }
            }
    
            private void UpdateData()
            {
                if (combobox1.Text.Length > 1)
                {
                    List<string> searchData = Search.GetData(combobox1.Text);
                    HandleTextChanged(searchData);
                }
            }       
    
            //If an item was selected don't start new search
            private void combobox1_SelectedIndexChanged(object sender, EventArgs e)
            {
                _needUpdate = false;
            }
    
            //Update data only when the user (not program) change something
            private void combobox1_TextUpdate(object sender, EventArgs e)
            {
                _needUpdate = true;
            }
    
            //While timer is running don't start search
            //timer1.Interval = 1500;
            private void RestartTimer()
            {
                timer1.Stop();
                _canUpdate = false;
                timer1.Start();
            }
    
            //Update data when timer stops
            private void timer1_Tick(object sender, EventArgs e)
            {
                _canUpdate = true;
                timer1.Stop();
                UpdateData();
            }
    
            //Update combobox with new data
            private void HandleTextChanged(List<string> dataSource)
            {
                var text = combobox1.Text;
    
                if (dataSource.Count() > 0)
                {
                    combobox1.DataSource = dataSource;  
    
                    var sText = combobox1.Items[0].ToString();
                    combobox1.SelectionStart = text.Length;
                    combobox1.SelectionLength = sText.Length - text.Length;
                    combobox1.DroppedDown = true;
    
    
                    return;
                }
                else
                {
                    combobox1.DroppedDown = false;
                    combobox1.SelectionStart = text.Length;
                }
            }
    

    This solution isn’t very cool. So if someone has another solution please share it with me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My problem is very similar to this one but I don't see why my
I'm having a problem similar to the one discussed in this thread , but
I have a problem similar to this one: How can I execute code after
I got a problem similar to this one: FileSystemWatcher - only the change event
My problem is extremely similar to the one described in this SO question ,
I have checked this similar question, but the suggestions did not solve my problem:
Here's a recurring problem. There are similar questions on SO about this, but nothing
First off, my problem is quite similar to this one . I would like
Question is similar to this (unanswered) and this one (same problem not involving Git).
I have seen few questions similar to this one, but I wanted to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.