Click here to Skip to main content
Licence CPOL
First Posted 1 Oct 2004
Views 103,753
Downloads 1,071
Bookmarked 50 times

Never-ending Progress Bar (C#)

By | 1 Oct 2004 | Article
The VB.NET Never-ending Progressbar now in C#

Sample Image - OSProgress.png

Introduction

Sometimes you just don’t know how long something will take. Like when your wife says she’ll only be a few minutes in the grocery store…you know what I mean.

The standard ProgressBar that ships with Visual Studio is great for when you know how long something will take, or there is a way to determine just how many steps a process will have. But like the trip to the store with your wife, sometimes you just can’t know how long something’s going to take. That’s why I created this progress bar.

More Information

For more information, please see http://www.codeproject.com/vb/net/NeverEndingBar.asp for the original article and VB.NET source.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Greg Osborne

Web Developer
American Equity Insurance
United States United States

Member

Visual Basic Developer since version 1.0
Java web developer
Currently developing in vb and c#

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralAwesome PinmemberJboy2017:12 30 Mar '07  
GeneralHmmmm Pinmembertayspen17:11 20 Nov '05  
GeneralRe: Hmmmm Pinmembertayspen9:18 30 Nov '05  
GeneralGreat control, but few idea's & Issue's PinmemberPriest Of Psi22:54 4 Oct '04  
GeneralRe: Great control, but few idea's & Issue's PinmemberGregOsborne4:39 5 Oct '04  
GeneralCan you post your sample working code!Re: Great control, but few idea's & Issue's PinmemberHaiyan Du5:00 2 May '08  
GeneralRe: Can you post your sample working code!Re: Great control, but few idea's & Issue's PinmemberHaiyan Du6:22 2 May '08  
I finished this task with the System.ComponentModel.BackgroundWorker
You have progressbar which autoprogress set to true and visible set to false.
when user start the program, no one will see this progress bar. when user click a button, this progress bar visible is set to true and we call SpineUp() now.
Big Grin | :-D Big Grin | :-D
here is my code:
---------------------
private System.ComponentModel.BackgroundWorker _backThread;
public Form1()
{
InitializeComponent();
_backThread=new System.ComponentModel.BackgroundWorker();
this._backThread.DoWork += new System.ComponentModel.DoWorkEventHandler(this.ProcessNumbersBackgroundWorker_DoWork);
this._backThread.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.ProcessNumbersBackgroundWorker_RunWorkerCompleted);


}

private void ProcessNumbersBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
//Do your work here
}
 
private void ProcessNumbersBackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
this._ProgressBarPanel.Visible=false;
MessageBox.Show("Done background work!");

}
private void button4_Click(object sender, EventArgs e)
{

this._ProgressBarPanel.Visible=true;
SpineUp();

}
private void SpineUp()
{

_backThread.RunWorkerAsync();

}
 
Haiyan DU

GeneralRe: Great control, but few idea's & Issue's PinmemberGregOsborne4:49 5 Oct '04  
GeneralFlickering... and solution PinmemberLEXXa12:45 2 Oct '04  
GeneralRe: Flickering... and solution PinmemberGregOsborne4:31 4 Oct '04  
GeneralRe: Flickering... and solution Pinmemberpolyester10:49 16 Nov '04  
GeneralRe: Flickering... and solution PinmemberGregOsborne10:55 16 Nov '04  
GeneralRe: Flickering... and solution Pinmemberpolyester7:07 17 Nov '04  
GeneralGreat! but... PinmemberCurtis W11:24 2 Oct '04  
GeneralRe: Great! but... PinmemberGregOsborne4:29 4 Oct '04  
GeneralRe: Great! but... PinmemberCurtis W16:00 4 Oct '04  
GeneralRe: Great! but... PinsussAnonymous16:55 4 Oct '04  
GeneralRefreshing Problem + Workaround PinmemberOrcrist11:25 1 Oct '04  
GeneralRe: Refreshing Problem + Workaround PinmemberGregOsborne11:28 1 Oct '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120529.1 | Last Updated 1 Oct 2004
Article Copyright 2004 by Greg Osborne
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid