Results 1 to 5 of 5

Thread: Seconds

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344
    This is my prob, i have a form running throughout the whole program. This form has a timer with the interval of 1000 (1sec). If it sees a form, i would like it to wait 5 seconds before it closes it. Now i dont want it ot call another timer to close it so is there any other way?
    -RaY
    VB .Net 2010 (Ultimate)

  2. #2
    Member Red Thread's Avatar
    Join Date
    Aug 2000
    Location
    Europe-Belgium
    Posts
    44

    Red face Sleepppppp....

    You could use the sleep function
    (but again, i think it's only in VB6)


    Code


    Private Declare Sub Sleep Lib "kernel32" _
    (ByVal dwMilliseconds As Long)

    Call Sleep(5000) '5 seconds

    End

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344

    ;o\

    Yeah vb doesnt have the sleep function, plus i want everything else to be working. I just want 1 form to close in 5 seconds. I guess im going to have to use another timer.....EEKKK
    -RaY
    VB .Net 2010 (Ultimate)

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    could you not do something like this.

    wherever you find the window open
    Timer2.interval = 1000
    Timer2.enabled=true
    x = x + 1
    if x = 5 then
    'close the window
    x = 0
    timer2.enabled = false
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You could have a counter counting the seconds in the timer
    Code:
    Static counter as integer
       'to activate it counter=counter+1
       if counter then counter=counter+1 'increments if activated
       if counter=6 then '5 seconds passed
           'do your stuff
           counter=0'disable the counter
       end if
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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