ADO DOT NET Posted November 30, 2007 Posted November 30, 2007 Hi, I have a progress bar on my start up form which I'd like to increase from its minimum to its maximum value after form loads! Here's what I try to do on Form_Load event: ... Me.Show() Application.DoEvents() For MyLoop As Integer = 1 To 100 MainForm.EditorProgressBarItem.Value = MyLoop Thread.Sleep(10) Next But it will prevent my form controls from being activated until progress bar fully loads! Is there any better way? I heard I should not use Thread.Sleep ?! :huh: Quote
Leaders snarfblam Posted December 1, 2007 Leaders Posted December 1, 2007 The ideal method would probably be to use a background worker for a multi-threaded approach. At the very least, throw an Application.DoEvents() in your loop. And, yes, throwing Thread.Sleep in a loop to time it is generally frowned upon. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.