Autocomplete email address and / or names in C #

I am looking for a solution similar to the one discussed here, but for C # WinForms. Link here

To rephrase, is it possible to autocomplete text fields in C # using a single data source with multiple lines? The result should be similar to Gmail TO: a field for creating e-mail or a similar field MS Outlook TO:

For example, a data set may be:
"John Williams" ( john.williams@gmail.com )
"Bob Johnson" ( john.jacobs@gmail.com )
"Willie Johnston" ( willy.williams@gmail.com )
"Willy Williams" ( johnjohn@gmail.com )

... and I would have to type "john" and all four would be offered. If I typed "johns" then the second and third entries will be suggested.

This is more advanced than the autocomplete provided by .NET by default.

Thanks Greg

+2
c # email autocomplete winforms
source share
4 answers

In the end, I wrote my own custom UserControl class to take care of this. It seemed that there was nothing that met my needs.

I provided the source and the DLL here under the BSD: http://code.google.com/p/email-autocomplete

Basically, it emulates the functionality of the To: field in Gmail, but, of course, in .NET.

+3
source share

WinForms 2.0 controls already provide this feature in the AutoCompleteSource property. You can set this to a data source or create your own list of rows using AutoCompleteStringCollection.

+3
source share
+1
source share

On the "Properties" tab (for example, "Text"), open the "Behavior" section and set the "AutoComplex" value to the desired value. You can do the same programmatically. For your control (e.g. TextBox TextBox1) call the autocomplete type and initialization value (e.g. TextBox1.AutoCompleteType = AutoCompleteType.Email;)

0
source share

All Articles