Damith Weerasinghe has a good point but I'm going to a little further.
I created a test version to test your function.
First you are not testing if the textbox is empty or not. if it is empty then you may end up with a null reference exception when the button is clicked.
You are using two seperate If statements.
Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
Dim pwd As String
If tbInput.Text = Nothing Then
MsgBox("No text entered")
Exit Sub
Else
pwd = tbInput.Text
End If
If ValidatePassword(pwd) = True Then
Form2.Show()
ElseIf ValidatePassword(pwd) = False Then
Form4.Show()
End If
Dim output As String = ValidatePassword(pwd).ToString
tbOutput.Text = output
End Sub
Modifying your code to read like:
Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
Dim pwd As String
If tbInput.Text = Nothing Then
MsgBox("No text entered")
Exit Sub
Else
pwd = tbInput.Text
End If
If ValidatePassword(pwd) Then
Form2.Show()
Else
Form4.Show()
End If
If ValidatePassword(pwd) Then
Form3.Show()
Else
Form4.Show()
End If
Dim output As String = ValidatePassword(pwd).ToString
tbOutput.Text = output
End Sub
If it passes it will open forms 2 and 3
if it fails it will open only form 4 once.
passing back a boolean value is ok for a test but it does not tell the user what part they failed in.
Also in a final version you may want to add the ability to change the values instead of using the default ones.
If you are wanting to check the text entered as it is being input you can use the
TextBox1_TextChanged
and just pass the value in the textbox1.text.
you will still need some form of feed back on what is not correct.
you may look into using the error provider.
http://msdn.microsoft.com/en-us/library/vstudio/a0d996e0(v=vs.100).aspx[
^]
Or some other form of feedback
Also the string "AAaa11" passes as valid using the default values which would not be a good passsword.
I hope that helps