Easy Login System
>> Jan 1, 2011
How to make login form?
1. Start new project2. drug two labels
3. change labels caption 1- username and 2- password
4. change form caption
5. drug two text boxes and command button
6. change name of textboxes, here made name as for textbox1 name will be "txtusername" and for second "txtpassword"
7. Change commands caption as OK and Cancel , here i will made for OK button " cmdok" and cmd Cancel
Now, Double click on Cancel button, you can see code window- type there
-----------------------------------------
Private Sub cmdCancel_Click()
End
End Sub
--------------------------------------
Next
Private Sub cmdOK_Click()
If txtUserName = "123" Then
If txtPassword = "123" Then
LoginSucceeded = True
Me.Hide
Load MDIForm1 'your main form
MDIForm1.Show ' mdiform1 is main form which from you will nevigate
Else
MsgBox "Invalid Password, try again!", vbInformation, "Massage"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
Else
MsgBox "Invalid User-ID, try again!", vbInformation, "Massage"
txtUserName.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub
---------------------
SIMPLE...... DONE IT...
0 comments:
Post a Comment