cara membuat autocomplete textbox
Imports System.Data.OleDb
Public Class autocompletetexbox
Private Sub autocompletetexbox_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call Koneksi()
TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest
TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
Dim DataCollection As New AutoCompleteStringCollection()
addItems(DataCollection)
TextBox1.AutoCompleteCustomSource = DataCollection
End Sub
Public Sub addItems(ByVal col As AutoCompleteStringCollection)
CMD = New OleDbCommand("select distinct satuan from tblbarang", CONN)
DR = CMD.ExecuteReader
Do While DR.Read
col.Add(DR.Item("satuan"))
Loop
End Sub
End Class