hi,
i have an application that uses a progress bar. i insert records to database in a loop and i want to show the progress. in my loop i have set
progressbarobject.value=loopcount.
but it doesnt show while the loop is running. How to fix this issue?
bye.
Anushka
Loading
Hiren SoniPosted Aug 4, 2010, 6:20 AM
Anushka ThilakarathnePosted Aug 4, 2010, 2:30 AM
Thanks alot
Hiren SoniPosted Aug 3, 2010, 10:05 AM
// set progress bar property like this :
progressBar1.Minimum = 0;
progressBar1.Maximum = 100;
progressBar1.Step = 1;
// here is your for loop
for (int i = 0; i < 100; i++)
{
progressBar1.PerformStep();
// your other code work here
}
Kirtan PatelPosted Aug 3, 2010, 9:59 AM
private void button1_Click(object sender, EventArgs e)
{
/* Set Max value in Progressbar same as Number of rows you are adding
I assumed it 100
*/
progressBar1.Maximum = 100;
progressBar1.Step = 1;
progressBar1.Value = 0;
for (int i = 0; i < 100; i++)
{
// Code to ad record what ever code you have
progressBar1.Value = i;
}
}
its works perfect now ..