Form1.cs
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespace_0055 {-
publicpartialclassForm1 : Form { -
publicForm1() { -
InitializeComponent(); -
} -
//кнопка Start -
privatevoidbutton1Start_Click(objectsender, EventArgs e) { -
timer1.Start(); -
} -
//кнопка Clear -
privatevoidbutton2Clear_Click(objectsender, EventArgs e) { -
progressBar1.Value = 0; -
label1.Text =string.Empty; -
label2.Text =string.Empty; -
} -
//таймер -
privatevoidtimer1_Tick(objectsender, EventArgs e) { -
progressBar1.Increment(5); -
if(progressBar1.Value == progressBar1.Maximum) { -
timer1.Stop(); -
} -
label1.Text = progressBar1.Minimum.ToString(); -
label2.Text = progressBar1.Value.ToString(); -
} -
} }
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespace_0055 {-
publicpartialclassForm1 : Form { -
publicForm1() { -
InitializeComponent(); -
} -
//кнопка Start -
privatevoidbutton1Start_Click(objectsender, EventArgs e) { -
timer1.Start(); -
} -
//кнопка Clear -
privatevoidbutton2Clear_Click(objectsender, EventArgs e) { -
progressBar1.Value = 0; -
label1.Text =string.Empty; -
label2.Text =string.Empty; -
} -
//таймер -
privatevoidtimer1_Tick(objectsender, EventArgs e) { -
progressBar1.Increment(5); -
if(progressBar1.Value == progressBar1.Maximum) { -
timer1.Stop(); -
} -
label1.Text = progressBar1.Minimum.ToString(); -
label2.Text = progressBar1.Value.ToString(); -
} -
} }