Progress Bar

Well, I really dont know how a progress bar really works. Well what I want is to be connected to a button_click event. When I press a button, I want it to fill up then disappear. How would I do that


Answer this question

Progress Bar

  • PaTaKi

    Hi.


    maybe you can try :



    ProgressBar.Visible = false;
     



    greetings


  • SpyKraft

    Ok. I still dont understand. I figured out how to use the timer with the progress bar, but when it fills up, I need it to disappear. How would I do that

  • Roboss Liu

    Hi,

    Here is a tutorial on Progress Bars:
    http://www.c-sharpcorner.com/winforms/working_with_progressbar.asp

    Regards,
    Vikram

  • Regula

    One solution is to wireup the Click event of the ProgressBar. In the event handler check to see if the ProgressBar's value is equal to its Maximum, like this:



    public MyConstructor ()
    {
      pb = new ProgressBar();
      pb.Click += new EventHandler(pb_Click);
    }

    void pb_Click (object sender, EventArgs e)
    {
      if (pb.Value == pb.Maximum)
      {
        pb.Visible = false;
      }
    }

     

    You will of course have to worry about thread-safe practices if you're using multiple threads (I assume you are).

  • Progress Bar