This post is about how to set password in vb6. Here is coding given with example and image clearly.
CODE-
Option Explicit
Dim realpassw As String
Dim ichance As Integer
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
realpassw = "ramramji"
Text1.PasswordChar = "#"
PASSWORD.Height = 11520
PASSWORD.Left = 0
PASSWORD.Top = 0
PASSWORD.ScaleHeight = 11010
PASSWORD.ScaleLeft = 0
PASSWORD.ScaleTop = 0
PASSWORD.ScaleWidth = 19080
PASSWORD.Width = 19200
End Sub
Private Sub Command1_Click()
If Text1 = realpassw Then
Label1 = "succed"
SSS.Show
Unload Me
Exit Sub
Else
Label1 = "login failed"
MsgBox "password incurrect"
ichance = ichance + 1
If ichance = 3 Then Unload Me
End If
End Sub
0 comments:
Post a Comment