Copy Code code as follows:
Using System;
Using System.Drawing;
Using System.Collections;
Using System.ComponentModel;
Using System.Windows.Forms;
Using System.Data;
Using System.Diagnostics;
Using System.Threading;
Namespace WindowsApplication2
{
<summary>
Summary description of the Form1.
</summary>
public class Form1:System.Windows.Forms.Form
{
Private System.Windows.Forms.Button button1;
Private System.Windows.Forms.ProgressBar progressBar1;
Private System.Windows.Forms.ProgressBar progressBar2;
Private System.Windows.Forms.TextBox TextBox1;
Private System.Windows.Forms.TextBox TextBox2;
<summary>
The required designer variable.
</summary>
Private System.ComponentModel.Container components = null;
Public Form1 ()
{
//
Required for Windows Forms Designer support
//
InitializeComponent ();
//
TOD adds any constructor code after the InitializeComponent call
//
}
<summary>
Clean up all resources that are in use.
</summary>
protected override void Dispose (bool disposing)
{
if (disposing)
{
if (Components!= null)
{
Components. Dispose ();
}
}
Base. Dispose (disposing);
}
Code generated #region the Windows forms Designer
<summary>
Designer supports required methods-do not use the Code editor to modify
The contents of this method.
</summary>
private void InitializeComponent ()
{
This.button1 = new System.Windows.Forms.Button ();
THIS.PROGRESSBAR1 = new System.Windows.Forms.ProgressBar ();
THIS.PROGRESSBAR2 = new System.Windows.Forms.ProgressBar ();
This.textbox1 = new System.Windows.Forms.TextBox ();
This.textbox2 = new System.Windows.Forms.TextBox ();
This. SuspendLayout ();
//
Button1
//
This.button1.Location = new System.Drawing.Point (160, 184);
This.button1.Name = "Button1";
This.button1.TabIndex = 1;
This.button1.Text = "Button1";
This.button1.Click + = new System.EventHandler (This.button1_click);
//
ProgressBar1
//
this.progressBar1.Enabled = false;
This.progressBar1.Location = new System.Drawing.Point (32, 16);
This.progressBar1.Name = "ProgressBar1";
This.progressBar1.Size = new System.Drawing.Size (336, 32);
This.progressBar1.TabIndex = 2;
//
ProgressBar2
//
This.progressBar2.Location = new System.Drawing.Point (32, 72);
This.progressBar2.Name = "ProgressBar2";
This.progressBar2.Size = new System.Drawing.Size (328, 24);
This.progressBar2.TabIndex = 3;
//
TextBox1
//
This.textBox1.Location = new System.Drawing.Point (48, 136);
This.textBox1.Name = "TextBox1";
This.textBox1.TabIndex = 4;
This.textBox1.Text = "100";
//
TextBox2
//
This.textBox2.Location = new System.Drawing.Point (216, 136);
This.textBox2.Name = "TextBox2";
This.textBox2.TabIndex = 5;
This.textBox2.Text = "100";
//
Form1
//
This. AutoScaleBaseSize = new System.Drawing.Size (6, 14);
This. BackColor = System.Drawing.SystemColors.Desktop;
This. ClientSize = new System.Drawing.Size (408, 222);
This. Controls.Add (THIS.TEXTBOX2);
This. Controls.Add (This.textbox1);
This. Controls.Add (THIS.PROGRESSBAR2);
This. Controls.Add (THIS.PROGRESSBAR1);
This. Controls.Add (This.button1);
This. Name = "Form1";
This. Text = "Form1";
This. ResumeLayout (FALSE);
}
#endregion
<summary>
The main entry point for the application.
</summary>
[STAThread]
static void Main ()
{
Application.Run (New Form1 ());
}
private void Button1_Click (object sender, System.EventArgs e)
{
int outloop = Int32.Parse (TextBox1.Text);
int innerloop = Int32.Parse (TextBox2.Text);
for (int i=1;i<=outloop;i++)
{
for (int j=i;j<=innerloop;j++)
{
if (j%10 = 0)
{
Progressbar2.value = j;
Thread.Sleep (100);
}
}
progressBar1.Value = i;
}
}
}
}