AutoComplete in .NET Winforms TextBox


  Winforms Textbox has a property called AutoCompleteMode,  that can be used to display textbox values like a predictive Google search. You can provide a custom list of items that can be used as values in textbox.

The following code snippet demonstatrates implementation.


.NET Winforms TextBox AutoComplete

  private void Form1_Load(object sender, EventArgs e)

        {

            tbCountry.AutoCompleteMode = AutoCompleteMode.Suggest;

            tbCountry.AutoCompleteSource = AutoCompleteSource.CustomSource;

           tbCountry.AutoCompleteCustomSource = CountryList();

        }

 

        private  AutoCompleteStringCollection CountryList()

        {

            AutoCompleteStringCollection List = new AutoCompleteStringCollection();

            List.Add("Albania");

            List.Add("Algeria");

            List.Add("America");

            List.Add("Angolia");

            List.Add("Antartica");

            List.Add("Australia");

            List.Add("India");

 

            return List;

        }





Zooming in Winforms Webbrowser Control in .NET
Filtering Datatable with Select Conditions and Sorting in C#.NET
Hiding a property from displaying in Datagridview in C#.NET
Logic to detect if Application is started from Citrix/Terminal Server/PC in C#
Winforms Application.DoEvents Method
Modify XML file with tagname in c#.net
Read Machine IP Address in C#
Check if IIS is running using C#
Implementing IEnumerable in C#
Built in Delegates in .NET Framework
Changing Winform webbrowser control IE version in C#.NET
Set the dropdown width of any combobox based on the data
Difference between Const and ReadOnly
Example for Property Change Notification in C#.NET
Example Program using Delegates and Events in C#
How to read data from XML String and insert in to table in SQL Server
WebBrowser.navigate Data Submission by Get or Post Methods
Datagridview Paging
Copy Datagridview cell value using ContextMenu
Inserting data in Datatable in C#
Cookie in .NET
Using Control's Child Index and Dock property for achieving desired layout in a form.
Accessing section group inside configuration of web.config
Create File in .NET C#
Change button shape in .net
Dispose vs Finalize in .net




AutoComplete in Textbox winforms, windows , .NET windows application