473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How to have a progress bar for loading a windows Forms?

i m Developing a Software application where the windows forms are used .
i want a starting Window where user don't have to do anything as it loads the Windows Forms, the forms are taking more time than required so , it looks that each control loads each time and looks very bad, so i want to give a starting progress bar. and as the Windows controls are loaded , then user should get the full form in front of him,
also in transition from one form to another, i want to put in between the forms disposing and loading the new one
please suggest me solutions
Edit/Delete Message
Aug 26 '08 #1
10 3900
cloud255
427 Expert 256MB
there is a .NET progress bar which you could use, its a pretty basic control and you can create forms, so the transisiton forms wont be a problem. What is the exact part which you are stuck with?
Your question is a bit vague, if you could clarify a bit more, we could offer some more relevant help...
Aug 26 '08 #2
Cloud!! the problem is i want to put this Progress Bar of .Net in between two forms transition.and problem is simple ,, i only know to run the Progress bar with the help of timer and ticks , what i actually want to do it, is that Progress bar should move according to the Form load instead of Timer , so how can i check whats the form state and when it is ready to be used by the User .
i want to make Form visible only when all controls are loaded and Mean time Progress Bar runs , to notify user that he have to wait.
thanks for answering!
Aug 27 '08 #3
Curtis Rutland
3,256 Expert 2GB
Well, you're probably going to have to calculate the total amount of steps, set that as the max value for the progress bar, and after each step you do increment the progress bar.
Aug 27 '08 #4
Hey can you elaborate on it , how can I calculate that!!
Aug 27 '08 #5
This what is got as help for Timer based Running ,, but need process based Running of progress bar
Expand|Select|Wrap|Line Numbers
  1.  
  2.     private void Main_Load(object sender, EventArgs e)
  3.         {
  4.             Thread t = new Thread(new ThreadStart(Go));
  5.             timer1.Enabled = true;
  6.             this.Visible = false;
  7.             t.Start();
  8.         }
  9.  
  10.         private static void Go()
  11.         {
  12.  
  13.             timer1.Interval = 100;
  14.  
  15.             timer1.Start();
  16.         }
  17.  
  18.         private void timer1_Tick(object sender, EventArgs e)
  19.         {
  20.             int x = 1;
  21.  
  22.             progressBar1.Increment(x);
  23.  
  24.             if (progressBar1.Value == 100)
  25.             {
  26.  
  27.                 timer1.Enabled = false;
  28.                 progressBar1.Visible = false;
  29.                 this.Visible = true;
  30.             }
  31.  
  32.         }
  33.         #endregion
  34.  
Aug 27 '08 #6
Curtis Rutland
3,256 Expert 2GB
Maybe you should post the part of your code that is running so slowly that you need to use the progress bar. That might help.
Aug 27 '08 #7
cloud255
427 Expert 256MB
Cloud!! the problem is i want to put this Progress Bar of .Net in between two forms transition.and problem is simple ,, i only know to run the Progress bar with the help of timer and ticks , what i actually want to do it, is that Progress bar should move according to the Form load instead of Timer , so how can i check whats the form state and when it is ready to be used by the User .
i want to make Form visible only when all controls are loaded and Mean time Progress Bar runs , to notify user that he have to wait.
thanks for answering!

Well that was, uhhh, enthusiastic. Ok so you want to base the progress bar on something else, you say that the controls take long to load, i dont think it is the controls, but rather putting data in those controls, like Insert said, if you post the 'slow' code we could have a look at it and try to make it faster.

If it is the actaul controls which are slow, you could subscribe to the Paint event for each contorl on the form, and each time this fires increase the total completion of the progress bar by 1/numberOfControls * 100.

Hope you find this post more helpful.
Aug 27 '08 #8
Curtis Rutland
3,256 Expert 2GB
If it is the actaul controls which are slow, you could subscribe to the Paint event for each contorl on the form, and each time this fires increase the total completion of the progress bar by 1/numberOfControls * 100.
You explained it better than I did...it's 1:50 AM for me...way too tired...zzzzzz
Aug 27 '08 #9
Thanks a lot friends, i hv another found about this matter that, Can We Use BackGroundWorker in this Situation, if yes, then kindly help me, with example!
Aug 30 '08 #10
joedeene
583 512MB
take a look at this link...
http://bytes.com/forum/thread355878.html

perhaps more browsing on google or even this site's search engine would've been what you were looking for.
Aug 30 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: simon | last post by:
when I execute aspx page, it works about 5 minutes - I calculate some statistics. Is there some way, that I can show user time bar or smething similar? That he nows, that page is working. ...
2
by: Rob | last post by:
I was working on a project and everything was going fine, then all of a sudden the form set as my startup object stopped loading. I tried setting some others as the startup object, and some of my...
8
by: Brian Henry | last post by:
I created a smooth progress bar with this code.. but if you update the values in a row quickly of it and watch it on screen it flickers... how would i change this to reduce the flickering?...
3
by: bennett.sean | last post by:
Hi, I've tried a number of different things including the use of threads and timers, but can't come up with the solution yet. The issue is this: launch a window with an animation or progress...
3
by: mohanmca | last post by:
Normmally we can show the user what happening in background. For example we can give the Refresh() method. I want use same thing in ASP.Net
8
by: Pieter | last post by:
Hi, I'm having some weird problem using the BackGroundWorker in an Outlook (2003) Add-In, with VB.NET 2005: I'm using the BackGroundWorker to get the info of some mailitems, and after each item...
9
by: Scirious | last post by:
People, I want to do same things with a progress bar but I don't know how. So, how do I change it to make it a solid bar, not a step byt step as the default? And how do I make it a vertical bar?...
3
by: Gabe Matteson | last post by:
I am trying to set the maximum value of the progress bar so that when a user searches through the specified directory they can see their status. the progress bar name is on form2 and is named...
2
by: Simon | last post by:
Hello, I would like to know if there is a way to display a progressbar while loading a page. (We developped our application in Caché (intersystems), some functions need some time to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.