Advertisement
Guest User

Untitled

a guest
Jun 19th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Login
  2.     Dim texttype As String
  3.     Dim textbox As String
  4.     Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
  5.         Dim username As String
  6.         Dim password As String
  7.  
  8.         username = TextBox1.Text
  9.         password = TextBox2.Text
  10.  
  11.         'Me.Close()
  12.    End Sub
  13.     Private Sub TextBox1_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
  14.         texttype = "username"
  15.     End Sub
  16.     Private Sub TextBox2_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBox2.Validating
  17.         texttype = "password"
  18.         textbox = "TextBox2"
  19.  
  20.         Call CheckText(textbox, texttype)
  21.     End Sub
  22.     Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
  23.         Me.Close()
  24.     End Sub
  25.     Public Function CheckText(ByVal text, ByVal texttype) As Boolean
  26.         If text.length = 0 Then
  27.             MessageBox.Show("You must enter a " & texttype & ".")
  28.         ElseIf text.length < 6 And text.length > 0 Then
  29.             MessageBox.Show("Your " & texttype & " does not match the requirements.")
  30.         End If
  31.         Return False
  32.     End Function
  33. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement