Results 1 to 3 of 3

Thread: Counter/Picture Box

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 1999
    Posts
    3
    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!

  2. #2
    Addicted Member
    Join Date
    Jan 1999
    Posts
    239
    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


  3. #3
    Addicted Member
    Join Date
    Jan 1999
    Posts
    239
    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


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