Reputation: 5001
what control can i use to place in my programme so that i can have a loading bar. For example
ProgressBar pb = new ProgressBar();
pb.start();
connectToDatabase();
pb.stop();
Is this possible in c#?
Thanks
Upvotes: 1
Views: 9366
Reputation: 67213
A ProgressBar requires your code to periodically update the progress as you work through the task. Also, the progress only has meaning when you can roughly calculate what percent you have completed.
If you just want something moving to show that the program is busy, you can set the progress bar Style
property to ProgressBarStyle.Marquee
. This style is used to indicate something is happening without reporting the percent the task is complete.
Upvotes: 3
Reputation: 71573
Sure. There's a ProgressBar control in the Windows Forms library. Set its Style to Marquee and you should get a scrolling on/off pattern that indicates progress is being made.
Upvotes: 4
Reputation: 1247
Is there not a simple control called progressbar? Or are you asking something more complex that I'm missing?
Heres a knowledgebase article about created a smooth progressbar Link to Article.
Upvotes: 1