Also, note that you did say "the button does not work". You can disable the button so that it will not respond if a user tries to click it:

vb.net Code:
  1. Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  2.     If TextBox1.Text = "" Then
  3.         Button1.Enabled = False
  4.     Else If TextBox1.Text <> "" Then
  5.         Button1.Enabled = True
  6.     End If
  7. End Sub