|
-
Oct 26th, 2006, 07:51 AM
#1
Thread Starter
Lively Member
[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?
-
Oct 26th, 2006, 08:01 AM
#2
Re: [VB6] Successfully Login Display
Try this
VB Code:
'Add this to the top of the declrations
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
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
Sleep (500) 'wait for 500 milliseconds --->nes
Unload Me
Load frmAccount
frmAccount.Show
Else
labelErrorAccount.Caption = "Sorry, your PIN number is invalid"
labelErrorAccount.Visible = True
End If
End If
End Sub
-
Oct 26th, 2006, 08:07 AM
#3
Thread Starter
Lively Member
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?
-
Oct 26th, 2006, 08:11 AM
#4
Re: [VB6] Successfully Login Display
Increae the value in ( ), as long as you required (in milliseconds)
VB Code:
Sleep (5000) 'wait for 500 milliseconds --->nes
Last edited by danasegarane; Oct 26th, 2006 at 08:16 AM.
-
Oct 26th, 2006, 08:19 AM
#5
Thread Starter
Lively Member
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?
-
Oct 26th, 2006, 08:24 AM
#6
Re: [VB6] Successfully Login Display
change this for 10 seconds .ie --Sleep (10000)
-
Oct 26th, 2006, 08:36 AM
#7
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|