Results 1 to 7 of 7

Thread: [RESOLVED] [VB6] Successfully Login Display

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2006
    Posts
    74

    Resolved [RESOLVED] [VB6] Successfully Login Display

    Greetings all, this is wad i've done..

    <code>
    Private Sub txtPin_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    If txtPin.Text = "1234" Then
    labelErrorAccount.Visible = True
    labelErrorAccount.Caption = "Login Successful."
    txtPin.Visible = True

    Unload Me
    Load frmAccount
    frmAccount.Show

    Else
    labelErrorAccount.Caption = "Sorry, your PIN number is invalid"
    labelErrorAccount.Visible = True

    End If
    End If

    End Sub

    </code>


    Ok when the pin is correct, it doesnt displays "Login Successful." it straight away unloads the form and load another form. how do i make it wait for like 3seconds so it would display login successful then unload the form?

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: [VB6] Successfully Login Display

    Try this
    VB Code:
    1. 'Add this to the top of the declrations
    2. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    3.  
    4.  
    5. Private Sub txtPin_KeyPress(KeyAscii As Integer)
    6. If KeyAscii = 13 Then
    7. If txtPin.Text = "1234" Then
    8. labelErrorAccount.Visible = True
    9. labelErrorAccount.Caption = "Login Successful."
    10. txtPin.Visible = True
    11. Sleep (500) 'wait for 500 milliseconds --->nes
    12. Unload Me
    13. Load frmAccount
    14. frmAccount.Show
    15.  
    16. Else
    17. labelErrorAccount.Caption = "Sorry, your PIN number is invalid"
    18. labelErrorAccount.Visible = True
    19.  
    20. End If
    21. End If
    22.  
    23. End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2006
    Posts
    74

    Re: [VB6] Successfully Login Display

    thanks for reply danasegarane, but it didnt work.
    it waited for "x" amount of time and then unload form and load new form without showing the label. Any idea?

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: [VB6] Successfully Login Display

    Increae the value in ( ), as long as you required (in milliseconds)

    VB Code:
    1. Sleep (5000) 'wait for 500 milliseconds --->nes
    Last edited by danasegarane; Oct 26th, 2006 at 08:16 AM.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2006
    Posts
    74

    Re: [VB6] Successfully Login Display

    yup i know i did increase the value so it has a longer time to display but it doesnt display the label. instead it waits for the amount of time(x) and unload form and load another form.... wads wrong?

  6. #6
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: [VB6] Successfully Login Display

    change this for 10 seconds .ie --Sleep (10000)

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Oct 2006
    Posts
    74

    Re: [VB6] Successfully Login Display

    sigh.. it doesnt work.. on sleep it totally stop doing anothing making u unable to select anything and wait for 10seconds and it unload form and load another form.. totally skipped showing login successful label.. =(

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