Autofill
To Autofill the TextBox by passing the parameters
-----------------------------------------------
Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress
Dim FindString As String
If Asc(e.KeyChar) = Keys.Escape Then
ComboBox1.SelectedIndex = -1
ComboBox1.Text = ""
ElseIf Asc(e.KeyChar) = Keys.Back Then
If ComboBox1.Text.Length > 0 Then
ComboBoxAutoComplete(ComboBox1, ComboBox1.Text.Remove(ComboBox1.Text.Length - 1, 1))
End If
Else
ComboBoxAutoComplete(ComboBox1, ComboBox1.Text)
End If
e.Handled = True
End Sub
Private Sub ComboBoxAutoComplete(ByVal combo As ComboBox, ByVal str As String)
Dim index As Integer
If str.Length = 0 Then
combo.SelectedIndex = -1
combo.Text = ""
Else
index = combo.FindString(str)
If index <> -1 Then
combo.SelectedIndex = index
combo.SelectionStart = str.Length
combo.SelectionLength = combo.Text.Length - combo.SelectionStart
End If
End If
End Sub
I have an application for in that i am doing the criteria of remember me.. But the value is not auto filling in text box any suggestions.
Thanks For Help