Hello there...
How to make a text.box password prompt only
3 times after that if the users have enter wrong
password the program will close.
Printable View
Hello there...
How to make a text.box password prompt only
3 times after that if the users have enter wrong
password the program will close.
First set the PasswordChar to * in the Textbox properties, then
Option Explicit
Dim Att_Cnt As Integer
Private Sub Form1_Load()
Att_Cnt = 0
End Sub
Private Sub Command1_Click()
If StrComp(Text1,"<Your Password>,vbBinaryCompare) <> 0 Then
If Att_Cnt < 3 Then
' Increase the counter
Att_Cnt = Att_Cnt + 1
Text1.SetFocus
Else
' Close the Program
End
End If
Else
' Load your application here.
End If
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1)
End Sub
Is this all you need? :)
Thanks Chris...
Yes thats what I need.
Sorry Chris about that, I'm not familiar with MsChart control and never use that.
Hopefully you can ask our Bulletin Board members and could help you.
Thanks again.