Como hacer que espere tu aplicación con un “wait” en vb.net

By | 2010/09/29

Si quieres que tu aplicación espere solo debes hacer un llamado a esta pequeña rutina:

Private Sub Wait(ByVal PMillseconds As Integer)

Dim TimeNow As DateTime
Dim TimeEnd As DateTime
Dim StopFlag As Boolean

TimeEnd = Now()
TimeEnd = TimeEnd.AddMilliseconds(PMillseconds)
StopFlag = False
While Not StopFlag
TimeNow = Now()
If TimeNow > TimeEnd Then
StopFlag = True
End If
Application.DoEvents()
End While

TimeNow = Nothing
TimeEnd = Nothing
End Sub

Saludos…

Leave a Reply

Your email address will not be published. Required fields are marked *

This blog is kept spam free by WP-SpamFree.