1
Answer

How to make a progress bar load in "bids"

Henrik Visby

Henrik Visby

10y
870
1
Hello fellow C# programmers,
 
 I am new to this language and trying having some fun in C# and I have stumpled upon a question now.
 
http://i.imgur.com/jwC3QLF.png 

As you see in the picture above, I have a progress bar and a button called "Mix", what happends when I press the button is the progress bar will start to load fully up.
 
What I want is when I press the button once, it will load the first lets say 1/3 of the bar, when I press it the second time it will load 2/3 of the bar and last time it will finish up 3/3 of the bar, as shown in the picture below.
http://i.imgur.com/v2QhkOD.png 
 
My code is pretty damn simple, a button, a timer and a progress bar
 
private void button1_Click(object sender, EventArgs e)
{
this.timer1.Start();
}

private void timer1_Tick(object sender, EventArgs e)
{
this.progressBar1.Increment(3);
}
 
Any help will be appreciated, but please talk in a language I can understand:P As I am new to C# as said^^
 
Best regards Henrik
Answers (1)