How to Create an AutoComplete in a TextBox in VB.Net

How to Create an AutoComplete in a TextBox in VB.Net

This tutorial is all about How to Create an AutoComplete in a TextBox in VB.Net.
When searching a record from the database using a TextBox in VB.Net, commonly, it’s hard for us to search the exact record.

So, In this tutorial, I created an autosuggest textbox, so that, it will be easy for you to search the correct record in the table.

For instance, the word “itsourcecode”.

This tutorial can answer the questions on How to Create an Autocomplete in a textbox in

Let’s begin:

Steps How to Create an AutoComplete in a TextBox in VB.Net

Step 1: First, create a database and name it “employeesdb” in the MySQL Database. after that, set this query for creating a table.

Step 2: After creating a table in the database, Insert all the records in the table that you have created.


Step 3: Open the Microsoft Visual Studio 2008 and create a new Windows Form Application. After that, Put a TextBox and a Label.
Step 4: Click the TextBox and go to the properties. In the properties, select the Suggest for the AutoComplete mode and select Custom Source for the AutoComplete Source.
Step 5: After setting up the properties of a textbox, go to the solution explorer and hit the code view.
Step 6: In the code view, set up your connection and declare all the classes that are needed.

Reminder: Before setting up your connection make sure that you will add MySql. Data. dll as your reference. So you will not encounter errors. Follow the instructions here the complete guide to add

Step 7: After the declaration, go back to the Form Design and double click it. Now, you have to set up the AutoComplete in the TextBox on the first load of the Form.

Complete Source Code is included. Download it and run on your computer.

Download here.

If you want to learn more about how to master with MySQL database in 30 minutes, watch and follow the instructions given the video.


If you have any questions or suggestions about this tutorial on how to create an autocomplete in textbox using please leave a comment below.

Readers might read also:


One Response

  1. mikado September 4, 2016

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.