Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If (TextBox1.Text <> "" And TextBox2.Text <> "") Then
Button1.Enabled = True
Else
Button1.Enabled = False
End If
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
If (TextBox1.Text <> "" And TextBox2.Text <> "") Then
Button1.Enabled = True
Else
Button1.Enabled = False
End If
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
'限制文本框只能输入数字
If Not System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "[0-9]") Then
e.Handled = True
Else
e.Handled = False
End If
End Sub