Advertisement
PlajariKode

#1 Desain Login Aplikasi Penjadwalan

Nov 29th, 2018
1,706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.44 KB | None | 0 0
  1.     Private Sub Form_Login_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  2.         txtUname.Focus()
  3.         txtUname.Clear()
  4.         txtUname.ForeColor = Color.Black
  5.     End Sub
  6.  
  7.     Private Sub txtUname_GotFocus(sender As Object, e As EventArgs) Handles txtUname.GotFocus
  8.         If txtUname.Text = "Username" And txtUname.ForeColor = Color.Gray Then
  9.             txtUname.Clear()
  10.             txtUname.ForeColor = Color.Black
  11.         Else
  12.             txtUname.ForeColor = Color.Black
  13.         End If
  14.     End Sub
  15.  
  16.     Private Sub txtUname_LostFocus(sender As Object, e As EventArgs) Handles txtUname.LostFocus
  17.         If txtUname.Text = "" Then
  18.             txtUname.Text = "Username"
  19.             txtUname.ForeColor = Color.Gray
  20.         End If
  21.     End Sub
  22.  
  23.     Private Sub txtPass_GotFocus(sender As Object, e As EventArgs) Handles txtPass.GotFocus
  24.         If txtPass.Text = "Password" And txtPass.ForeColor = Color.Gray Then
  25.             txtPass.Clear()
  26.             txtPass.ForeColor = Color.Black
  27.             txtPass.PasswordChar = "*"
  28.         Else
  29.             txtPass.ForeColor = Color.Black
  30.             txtPass.PasswordChar = "*"
  31.         End If
  32.     End Sub
  33.  
  34.     Private Sub txtPass_LostFocus(sender As Object, e As EventArgs) Handles txtPass.LostFocus
  35.         If txtPass.Text = "" Then
  36.             txtPass.Text = "Password"
  37.             txtPass.ForeColor = Color.Gray
  38.             txtPass.PasswordChar = ""
  39.         End If
  40.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement