0

My code example is:

string[] string_suggestion = {"suman goa - SGMN","sugar khamaturan - SKMN","goan kuman - GKMN","karan thapa - TTMN"};
       var source = new AutoCompleteStringCollection();
        source.AddRange(string_suggestion);
        textBox1.AutoCompleteCustomSource = source;
        textBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
        textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
// there are more than 1000 words 

Questions are:

  1. When user type "su" then suggestion come up words with S like:-suman goa - SGTMN,sugar khamaturan - SGKMN
  2. But when User Type "SG" which come after "-" in string, it is not appear in suggestion

When user type anything first word Or Last word divided by "-", come up entire string "suman goa - SGTMN" as a suggestion.

help-info.de
  • 6,695
  • 16
  • 39
  • 41
  • 1
    Possible duplicate of [C# Textbox Autocomplete: How to provide custom 'matching' function?](http://stackoverflow.com/questions/25959217/c-sharp-textbox-autocomplete-how-to-provide-custom-matching-function) – rene Feb 05 '17 at 11:46
  • no benifit from your link – Monika Tiwari Feb 06 '17 at 15:44
  • Hmm, I should have pick this dupe: http://stackoverflow.com/questions/796195/c-sharp-autocomplete the message is: What you want can't be done with the features offered by AutoComplete on the textbox. You have to roll your own. – rene Feb 06 '17 at 15:49

0 Answers0