Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when the Value property is equal to the Maxvalue propterty ,the progress of the progress bar is not 100%.Does the progressbar react slowly?
i do not know why.

C#
private void button1_Click(object sender, EventArgs e)
{
    f.Show();
    f.Visible = false;
    f.Show();
    f.Visible = false;
    new Thread(new ThreadStart(FunGo)).Start();
    f.ShowDialog(this);
}

Form1 f = new Form1();
private void FunGo()
{
    int i = 0;
    while (true)
    {
        f.Invoke(new MethodInvoker(delegate()
        {
            if(i<=100)
                f.Listen(i, 100);
        }));
        if (i == 100)
        {
            f.Invoke(new MethodInvoker(delegate()
            {
                f.Close();//when the progress ba does not show 100% ,the Form (f) closes
            }));
            break;
        }

        Thread.Sleep(100);
        i++;
    }
}
Posted
Updated 5-Feb-15 18:24pm
v2
Comments
DamithSL 5-Feb-15 22:51pm    
can you include sample code to recreate the issue? (use improve question link and update the question)
Richard MacCutchan 6-Feb-15 4:36am    
Where is the progress bar updated?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900