sekarang kita akan membuat login di visual basic 6.0 sekarang kita langsung ke tutorialnya.
1. sekarang buka aplikasi vb 6.0.
2. pilih standar exe.
3. tambahkan komponen 2 textbox, 2label, dan 3 commandbutton.
4. dan di bagian properties cari caption dan (name),dan isikan begini :
OBJEK
|
PROPERTIES
|
VALUE
|
FORM1
|
name
|
frmLogin
|
Caption
|
LOGIN
| |
StartUpPosition
|
centerscreen
| |
ControlBox
|
False
| |
Label1
|
name
|
Label1
|
caption
|
USER NAME
| |
Label2
|
Name
|
Label2
|
caption
|
PASSWORD
| |
Command1
|
Name
|
cmdOk
|
Caption
|
OKE
| |
Command2
|
Name
|
cmdkeluar
|
caption
|
KELUAR
|
KODE PROGRAM :
Private Sub cmdKeluar_Click()
End
End Sub
Private Sub cmdOk_Click()
If txtPassword.Text = "yabin" And txtUserId.Text = "stmikoke" Then
MsgBox "User Id dan Password Benar", vbInformation + vbOKOnly, "Selamat Bekerja"
Else
MsgBox "User Id dan Password Salah", vbCritical + vbOKOnly, "Salah"
End If
End Sub
Private Sub Form_Load()
MsgBox "Selamat Datang", vbInformation + vbOKOnly, "Selamat Datang"
End Sub
Private Sub txtPassword_GotFocus()
txtPassword.Text = ""
End Sub
Private Sub txtPassword_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdok.SetFocus
End If
End Sub
Private Sub txtPassword_LostFocus()
If txtPassword.Text = "" Then
MsgBox "Harus Diisi"
End If
End Sub
Private Sub txtUserID_GotFocus()
txtUserId.Text = ""
End Sub
Private Sub txtUserID_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtPassword.SetFocus
End If
End Sub
Private Sub txtUserID_LostFocus()
If txtUserId.Text = "" Then
MsgBox "Harus Diisi"
End If


0 comments:
Posting Komentar