Computer Science Canada

Delaying Functions

Author:  GodofOsiris [ Sun Oct 01, 2006 6:41 pm ]
Post subject:  Delaying Functions

How would I delay the application multiple times, then after each time I would make a img visable, what I am wondering is there a way to delay without using a timer, more so like the delay(time) function in turing.

Author:  NikG [ Sun Oct 01, 2006 8:25 pm ]
Post subject: 

Ummm... I suppose you could call some temporary function that's just a huge loop or something before continuing...

Why don't you want to use the Timer control? It's actually very flexible (and efficient compared to the above) once you learn how to use it well.

Author:  Silent Avenger [ Sun Oct 01, 2006 8:35 pm ]
Post subject: 

There is no way that I know of that will do that other than the timer. Also as NikG said the timer in VB is very flexible and is alot better than using a delay(time) function.

Author:  cool dude [ Mon Oct 02, 2006 11:47 am ]
Post subject: 

Silent Avenger wrote:
There is no way that I know of that will do that other than the timer. Also as NikG said the timer in VB is very flexible and is alot better than using a delay(time) function.


actaully there is one. you have to make a module and put this code in it

code:

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


now everytime you want to delay your program you have to write sleep(1000) and then refresh on the next line. the number in the brackets of sleep (1000) mean how many milliseconds to delay for. you can change it.

code:
sleep(1000)
refresh


hope that helps

Author:  Silent Avenger [ Mon Oct 02, 2006 3:19 pm ]
Post subject: 

cool dude wrote:
actaully there is one.

Well now thanks to you, I do know there is another way.

Author:  Remm [ Sun Oct 08, 2006 9:10 am ]
Post subject: 

Whats the code for this timer control... hehe It could be of use to me.. besides; that sleep one freezes the whole program, unfortionately

Author:  cool dude [ Sun Oct 08, 2006 11:10 am ]
Post subject: 

Remm wrote:
Whats the code for this timer control... hehe It could be of use to me.. besides; that sleep one freezes the whole program, unfortionately


following instructions is very important Wink now make sure its exactly the same as i posted. Note: everytime you use the sleep function you have to refresh! that is your problem


: