Rabu, 02 Juli 2014

Form Login Penerimaan Siswa Baru


1)      Form  Login
Form  login  berfungsi  sebagai  interface  awal  sebelum  memulai  Program  Penerimaan  Siswa  Baru.  Pada  saat  pertama  kali  masuk  Program   Penerimaan  Siswa  Baru  ini,  maka  akan  membuka  terlebih  dahulu  Form  Login  untuk  mengisikan  Username  dan  Password.  Form  Login  dapat  dilihat  pada  gambar dibawah :

Keterangan :
Keterangan  Form  Login
No
Komponen
Property
Value
1
Label1
Caption
LOGIN


Font
Pristina
2
Label2
Caption
Username


Font
Baskerville Old Face
3
Label3
Caption
Password


Font
Baskerville Old Face
4
Label4
Caption
Insert  Name  And  Password


Font
Baskerville Old Face
5
Text1
Caption
(Kosong)


Name
Txtuser


Font
Baskerville Old Face
6
Text2
Caption
(Kosong)


Name
Txtpass


Font
Wingdings


Password Char
L
7
Command1
Caption
Login


Name
CmdLog


Font
Baskerville Old Face
8
Command2
Caption
Cancel


Name
Cmdcan


Font
Baskerville Old Face
9
ProgressBar
Name
Pb1


Coding :
Dim users As String
Dim pass As String
Dim i As Integer



Private Sub cmd_can_Click()
End
End Sub

Private Sub cmd_log_Click()
Timer1.Enabled = True
End Sub

Private Sub Form_Load()
pass = "12345"
users = "abcde"
Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
i = i + 1
Me.ProgressBar1.Value = i
Me.Label5.Caption = i & "%"
If i = 100 Then
MenuUtama.Show
Me.Timer1.Enabled = False
Unload Me
End If

End Sub

Private Sub txt_pass_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If Me.txt_pass.Text = pass Then
        Unload Me
    ElseIf Me.txt_pass.Text = "" Then MsgBox "data tidak boleh kosong", vbOKOnly
    Me.txt_pass.SetFocus
    Else
    MsgBox "password salah, ulangi lagi....", vbCritical
    Me.txt_pass.Text = ""
Me.txt_pass.SetFocus
Exit Sub
End If
End If
End Sub
Private Sub txt_user_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
    If Me.txt_user.Text = users Then
    Me.txt_pass.SetFocus
    ElseIf Me.txt_user.Text = "" Then MsgBox "data tidak boeh kosong", vbOKOnly
    Me.txt_user.SetFocus
    Else
    MsgBox "username salah, ulangi lagi....", vbCritical
    Me.txt_user.Text = ""
    Me.txt_user.SetFocus
    Exit Sub
    End If
End If
End Sub

Jika Kita Salah Mengetikkan Username maka akan muncul :
 
 Jika Kita Salah mengetikan password akan tampil :


Jika anda memasukan username & password dengan benar maka akan tampil :
akan Tampil Menu Utama