Ubaci na formu jedan progressBar i jedan button, dodaj event za Click na taj button i ubaci ovo.
Code:
private const Int32 PROGRESS_INTERVAL = 5000;
private const Int32 TIMEOUT = 60000;
private System.Threading.Timer m_tmrProgress, m_tmrTimeout;
private void button1_Click(object sender, EventArgs e)
{
progressBar1.Maximum = TIMEOUT / PROGRESS_INTERVAL;
m_tmrProgress = new System.Threading.Timer(this.ProgressCallback, null, 1, PROGRESS_INTERVAL);
m_tmrTimeout = new System.Threading.Timer(this.TimeoutCallback, null, TIMEOUT, 0);
}
private delegate void IncrementTimerDelegate(int i);
private void IncrementTimer(int i)
{
progressBar1.Increment(i);
}
private void ProgressCallback(object state)
{
this.Invoke(new IncrementTimerDelegate(this.IncrementTimer), new object[] { 1 });
}
private void TimeoutCallback(object state)
{
m_tmrProgress.Dispose();
m_tmrTimeout.Dispose();
}
I zapamti: kada ostanes bez novca, zena te napusti, deca te vise ne zovu, a prijatelji okrenu ledja - MSDN ce uvek biti tu da ti pomogne

America national sport is called baseballs. It very similar to our sport, shurik, where we take dogs, shoot them in a field and then have a party.