Kamis, 16 Desember 2010

Membuat Auto Complete pada ComboBox di Vb.Net 2003


Try
If Char.IsControl(e.KeyChar) Then Return
With CbGolDarah
Dim ToFind As String = .Text.Substring(0, .SelectionStart) & e.KeyChar
Dim Index As Integer = .FindStringExact(ToFind)
If Index = -1 Then Index = .FindString(ToFind)
If Index = -1 Then Return
.SelectedIndex = Index
.SelectionStart = ToFind.Length
.SelectionLength = .Text.Length - .SelectionStart
e.Handled = True
End With
Catch ex As Exception
MsgBox(ex.Message)
End Try


Tidak ada komentar:

Posting Komentar