1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
'ajoute :
'-un textbox
'-un buton
'-un listbox
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ListBox1.DataSource = TextBox1.AutoCompleteCustomSource
TextBox1.Clear()
End Sub
Private Sub TextBox1_ModifiedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.ModifiedChanged
If TextBox1.Text.Length = 0 Then Return
If TextBox1.Text.Length > 0 And TextBox1.AutoCompleteCustomSource.Contains(TextBox1.Text) Then
Button1_Click(Me, e)
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show("ok str:" + TextBox1.Text)
End Sub
End Class |