kshadow22

#2 Creating A Form With Visual Basic

Mar 25th, 2014
101
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form1
  2.  
  3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4.         If TextBox1.Text = "kshadow22" And TextBox2.Text = "youtube" Then
  5.             Form2.Show()
  6.             Me.WindowState = FormWindowState.Minimized
  7.         Else
  8.             MsgBox("Error, Wrong Information Provided!")
  9.         End If
  10.     End Sub
  11.  
  12.     Private Sub TextBox1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseClick
  13.         If TextBox1.Text = ("Username") Then
  14.             TextBox1.Clear()
  15.         End If
  16.     End Sub
  17.  
  18.     Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  19.  
  20.     End Sub
  21.  
  22.     Private Sub TextBox2_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown
  23.         If e.KeyCode = Keys.Enter Then
  24.             Button1.PerformClick()
  25.         End If
  26.     End Sub
  27.  
  28.     Private Sub TextBox2_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox2.MouseClick
  29.         If TextBox2.Text = ("Password") Then
  30.             TextBox2.Clear()
  31.         End If
  32.     End Sub
  33.  
  34.     Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
  35.  
  36.     End Sub
  37.  
  38.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  39.  
  40.     End Sub
  41. End Class
RAW Paste Data