how to create a custom AutoComplete function like inbuilt Autocomplete function?

  ado.net, c++, visual-studio, windows, winforms

i want to create a autocomplete function like inbuilt autocomplete where when we type in combobox’s text editor filed a matching suggestion comes out like this Demo.
i don’t want to use inbuilt AutoCompleteMode.
i have create a AutoCompleteStringCollection named collection and filled it with my database data.
i really don’t know where to start as i am very new to programming and i searched for it all over the internet but found nothing related to it. i am really stuck, please help.

i tried this but i knew it will not work as i want

private void comboBox1_TextChanged(object sender, EventArgs e)
    {
        foreach(string s in collection)
        {
            if (comboBox1.Text.Contains(s))
            {
                comboBox1.Text = s;
            }
        }
    }

Source: Windows Questions

LEAVE A COMMENT