5
Contributors
9
Replies
14
Views
8 Years
Discussion Span
Last Post by mad4x4
0

If you use a short delay, user won't notice any freezing.

Threading.Thread.CurrentThread.Sleep(1000)

and the parameter is in milliseconds. Above code causes one second delay.

0

This does not work out. Please suggest any other solution.

0

Ok. Give more details, what do you exactly want to delay. Delay execution in a form? Delay execution in a class module and have still responsive UI? Delay the time before user can press a specific button but can press other buttons? Or what kind of scenario you have?

0

If you have a situation where you want to disable some controls in a form for a specific time, disable them, start Timer-control for a specific interval and in the Timer_Tick event enable controls.

0

other suggestion use timer.
question for u :
why teme64 suggestion with sleep() function doesn't work for u? cause i think is better to use sleep than timer control.

0

there's any available delay function in VB 2008?

for example, delay one second between each For Loop executing.

0

there's any available delay function in VB 2008?

for example, delay one second between each For Loop executing.

0

solved the case!!

just like what Teme64 suggested but there is one changing :

Threading.Thread.Sleep(ms)

that's all!!

0

What about

Public Class MyUtils
    Shared Sub Wait(ByVal numSeconds As Long)

        For i = 1 To numSeconds
            Threading.Thread.Sleep(1000)
            Application.DoEvents()
            Application.RaiseIdle(New System.EventArgs)
        Next

    End Sub

End Class
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.