Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,219 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,158 people online right now. Registration is fast and FREE... Join Now!




Progress Bars

 
Reply to this topicStart new topic

Progress Bars, Displaying progress bar while program is running

scalt
9 Dec, 2007 - 01:03 PM
Post #1

D.I.C Head
Group Icon

Joined: 22 Nov, 2007
Posts: 114



Thanked: 3 times
Dream Kudos: 25
My Contributions
Hi

I have implemented two progress bars in my project to let the user know how far through processing a file the program is, as well as how far through the batch of files it is. In theory these two bars work fine, except that when my program starts processing the files the window goes blank and the bars aren't displayed. When the program is done, everything returns to normal and the bars are displayed once again (both at 100%). Does anyone know how I can prevent this from happening (I want the bars to be displayed throughout the entire operation)

I can't really post code due to the size of the project, but if you want something specific I'll put it up.

Thankyou

This post has been edited by scalt: 9 Dec, 2007 - 01:36 PM
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Progress Bars
9 Dec, 2007 - 04:53 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,660



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
What is most likely happening is that you are running an intensive process (file processing) on the same thread as the user interface with the progress bar. If you are going to be doing some heavy work like that, it is wise to launch the file reading and processing in a separate thread as to keep the user interface responsive and drawing itself.

That way you can keep the progress bar working as it should while all that work is being taken care of in the background on a separate thread of execution.

I hope this makes sense. smile.gif

This post has been edited by Martyr2: 9 Dec, 2007 - 04:54 PM
User is offlineProfile CardPM
+Quote Post

scalt
RE: Progress Bars
9 Dec, 2007 - 07:43 PM
Post #3

D.I.C Head
Group Icon

Joined: 22 Nov, 2007
Posts: 114



Thanked: 3 times
Dream Kudos: 25
My Contributions
Thanks for that, I'll give it a go
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 05:37AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month