by Masood Siddiqui (2 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 2nd December 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
An easy way to use password for textbox.
Object Property Setting
Text1 Text (Empty)
PasswordChar *
Label1 Caption “Enter your password within 15 seconds.”
Command1 Caption “Try Password”
Timer1 Interval 15000
Enabled True (default setting)
Form1 Caption “Password”
To create the code
1. On the form, double-click the timer.
2. Type the following statements in the Timer1_Timer event
procedure:
3. In the timer_1Timer type the following code.
MsgBox ("Sorry, your time is up.")
End
If Text1.Text = "secret" Then
Timer1.Enabled = False
MsgBox ("Welcome to the system!")
End
Else
MsgBox ("Sorry, friend, I don’t know you.")
End If