In this step, you will specify the StartTaskButton and StopTaskButton, which will designate the button controls as the buttons that will start and stop the progress bar updating process.
Next to the RunTask event, enter ProgressBar1_RunTask. This creates an event in Code view, where you can enter the following code, so the event looks like this:
Visual Basic
Visual Basic |
Copy Code
|
---|---|
Protected Sub ProgressBar1_RunTask(sender As Object, e As C1.Web.Wijmo.Controls.C1ProgressBar.C1ProgressBarTaskEventArgs) For i As Integer = 0 To 99 System.Threading.Thread.Sleep(500) e.UpdateProgress(i) Next End Sub |
C#
C# |
Copy Code
|
---|---|
protected void ProgressBar1_RunTask(object sender, C1.Web.Wijmo.Controls.C1ProgressBar.C1ProgressBarTaskEventArgs e) { for (int i = 0; i < 100; i++) { System.Threading.Thread.Sleep(500); e.UpdateProgress(i); } } |
When the Start button is clicked, the RunTask event fires and calls the UpdateProgress method to update the progress bar by 1 integer every 500 milliseconds.