in 1st part i showed you how to do it by clicking button every time. this time you will have to click button just one time and your progressbar will fill itself till the end.
remember the code you're using in 1st part!!!
we will take it and use it in this part but we will also use timer object
for what is timer object, please use google...
ok
for this project you'll need to know code from 1st part, code i will give you here and how to put timer object on your form.
1. go to toolbox menu and find Timer object
2. double click on it and it will be a part of your form
3. go inside your timer1 object
4. enter next code:
private void timer1_Tick(object sender, EventArgs e)
{
progressBar1.Minimum = 0;
progressBar1.Maximum = 100;
progressBar1.Step = 10; //this can be any value from Minimum - Maximum
progressBar1.PerformStep();
}
remember!!! that's code from 1st part of this tutorial but now we're using it inside timer object, not button control5. go inside button control
6. enter next code:
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}
7. go back to your design view and click one time on timer object
8. your homework is to change values of Interval property and figure out what happens
this is a finished project of that simple program and try to compare my project with your


Sign In
Create Account



Back to top










