In this post we learn about autocomplete Textbox. This is a very simple task. Only you have to use some coding. The coding I have given below. Copy and paste it into your project. This below coding contains VB.net. For this only one form has to be created. After placing a number of tax boxes and a number of buttons, you will then have to go to SQL Server. From there, create a number table and a column and then insert the data, after that you see the same data in the taxt box. We need this code when we have to develop a software. That is, when we create a software description box, we have to use this coding. As you can see in the picture below.

Imports System.Data.SqlClient Imports System.Data.Sql Imports System.IO Public Class Form1 Dim constr1 As String = "" Dim conn1 As New SqlConnection(constr1) Dim dr1 As SqlDataAdapter Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim cmd1 As New SqlCommand(" select Name From Table1", conn1) Dim ds1 As New DataTable Dim da1 As New SqlDataAdapter(cmd1) Dim coll As New AutoCompleteStringCollection da1.Fill(ds1) For i = 0 To ds1.Rows.Count - 1 coll.Add(ds1.Rows(i)("Name").ToString()) Next TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource TextBox1.AutoCompleteCustomSource = coll TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest End Sub End Class
 
Top