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:
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged If TextBox1.Text = "" Then Button1.Enabled = False Else If TextBox1.Text <> "" Then Button1.Enabled = True End If End Sub




Reply With Quote