Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27414

[solved] Best way to "wait" when using form transitions?

$
0
0
I am using the DLL from the following google code project in order to create some transitions in my UI:

https://code.google.com/p/dot-net-transitions/

Now, the transitions happen asynchronously, so I am using a routine to wait until the transition finishes before proceeding with more code:

Code:

    Private Sub wait(ByVal timeTowait As Integer)
        Dim sw As New Stopwatch
        sw.Start()
        Do While sw.ElapsedMilliseconds < timeTowait
            Application.DoEvents()
        Loop
        sw.Stop()
    End Sub

Question is: From what I understand, waiting like this should be avoided (cpu intensive?) so what is a better way to wait for a duration of time?. I also would like to apply this logic to say, waiting for a web page to load database information (browser readystate and document complete isnt always representative of data being present, just the html page itself loading, when pulling from a database on some web pages). I am not really looking for sleep, either, preferably a method transparent to the user. Thanks!

Viewing all articles
Browse latest Browse all 27414

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>