Home Forums WinForms controls Other WinForms controls SearchMode in WinComboBox?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18484 |

    Are there any other options for SearchMode in the WinComboBox? We’re trying to allow a softseek/drilldown functionality where they start typing and it gets closer and closer to the value. Imagine this scenario.

    You have these 4 numbers in the list

    100
    120
    200
    220

    If I start typing a 1 it should highlight 100, if I then typed a 2 it will highlight 120. But if I typed a 3 instead it would unhighlight everything. When we’re dealing with thousands of very similar numbers the first character seek just isn’t good enough.

    Let me know if you guys have any ideas.

    Thanks,

    Nathan

    Imported from legacy forums. Posted by Nathan (had 2428 views)

    User (Old forums)
    Member
    Post count: 23064

    You will need to use a custom auto-complete source to do this.  Adding to your example, you can do something like the following : 

    AutoCompleteStringCollection coll = new AutoCompleteStringCollection();

    coll.AddRange(

    new string[] { “100”, “120”, “200”, ” 220″ } );

    winComboBox1.TextBoxArea.AutoCompleteMode =

    AutoCompleteMode.Append;

    //or, depending on how you want to display the suggested items, you can use the following instead

    winComboBox1.TextBoxArea.AutoCompleteMode =

    AutoCompleteMode.SuggestAppend;

     

    winComboBox1.TextBoxArea.AutoCompleteSource =

    AutoCompleteSource.CustomSource;

    winComboBox1.TextBoxArea.AutoCompleteCustomSource = coll;

     

    Imported from legacy forums. Posted by André (had 3471 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.