Timed event on form

Ice Rhino

Registered User.
Local time
Today, 01:26
Joined
Jun 30, 2000
Messages
210
I wish a label to be visible for only 10 seconds when the call is made to it. I am sure this is basic VB stuff. How can I set it so that when

Me.lblnodateten.Visible = True

is fired, a 10 second counter will kick off and then the line

Me.lblnodateten.Visible = False

will activate

Kindest Regards
 
Whenever you want to start the timer, use this code:

Code:
Me.lblnodateten.Visible = True
Me.TimerInterval = 1000

And put this code in your form's Timer event.

Code:
Private Sub Form_Timer()
    Static bytCount As Byte
    If bytCount = 10 Then
        Me.lblnodateten.Visible = False
        Me.TimerInterval = 0
        bytCount = 0
    Else
        bytCount = bytCount + 1
    End If
End Sub
 
Last edited:
I have put the code in in the two places suggested but the label does not disappear

Regards
 
Slight amendment to the code... :rolleyes:
 
The code I posted above...with the amendment. :rolleyes:
 
Works like a charm, thank you very much and apologies for not noticing the amended code

Kindest Regards
 

Users who are viewing this thread

Back
Top Bottom