I have a form with a picture box and a counter. While the counter is running, the picture flutters. Any idea how I can prevent the picture from constantly fluttering? Thanks!
Printable View
I have a form with a picture box and a counter. While the counter is running, the picture flutters. Any idea how I can prevent the picture from constantly fluttering? Thanks!
Start new Project; put a Picture box; timer;label and command button on form: Set the label's name to lblCounter;
set the command button's name to btnExit: User the following
code:
Code:
Option Explicit
Dim C As Double
Private Sub btnExit_Click()
Unload Me
End Sub
Private Sub Form_Load()
btnExit.Visible = False
C = Now
End Sub
Private Sub Timer1_Timer()
' Display timer for 10 seconds. After 10 seconds
' Exit button is displayed.
Const TM_STOP = 10 'Changing this number will change the length of time a screen stays up.
lblCounter = Format$(Now - C, "ss")
If Val(Format$(Now - C, "ss")) >= TM_STOP Then
End If
End Sub
Sorry, I left out a couple of lines of code in my reply
After:If Val(Format$(Now - C, "ss")) >= TM_STOP Then
Add the following two lines
Timer1.Enabled = False
btnExit.Visible = True
So the Timer1 sub should be as follows:
Private Sub Timer1_Timer()
' Display timer for 10 seconds. After 10 seconds
' Exit button is displayed.
Const TM_STOP = 10 'Changing this number will change the length of time a screen stays up.
lblCounter = Format$(Now - C, "ss")
If Val(Format$(Now - C, "ss")) >= TM_STOP Then
Timer1.Enabled = False
btnExit.Visible = True
End If
End Sub