Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Login
- Dim texttype As String
- Dim textbox As String
- Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
- Dim username As String
- Dim password As String
- username = TextBox1.Text
- password = TextBox2.Text
- 'Me.Close()
- End Sub
- Private Sub TextBox1_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
- texttype = "username"
- End Sub
- Private Sub TextBox2_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBox2.Validating
- texttype = "password"
- textbox = "TextBox2"
- Call CheckText(textbox, texttype)
- End Sub
- Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
- Me.Close()
- End Sub
- Public Function CheckText(ByVal text, ByVal texttype) As Boolean
- If text.length = 0 Then
- MessageBox.Show("You must enter a " & texttype & ".")
- ElseIf text.length < 6 And text.length > 0 Then
- MessageBox.Show("Your " & texttype & " does not match the requirements.")
- End If
- Return False
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement