Results 1 to 4 of 4

Thread: Write Password

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 1999
    Location
    Malaysia
    Posts
    108

    Post

    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.

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Post Am I correct?

    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?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 1999
    Location
    Malaysia
    Posts
    108

    Post

    Thanks Chris...

    Yes thats what I need.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 1999
    Location
    Malaysia
    Posts
    108

    Post MsChart Control

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width