Form1.cs
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows.Forms;
namespace
_0055 {
-
public
partial
class
Form1 : Form {
-
public
Form1() {
-
InitializeComponent();
-
}
-
//кнопка Start
-
private
void
button1Start_Click(
object
sender, EventArgs e) {
-
timer1.Start();
-
}
-
//кнопка Clear
-
private
void
button2Clear_Click(
object
sender, EventArgs e) {
-
progressBar1.Value = 0;
-
label1.Text =
string
.Empty;
-
label2.Text =
string
.Empty;
-
}
-
//таймер
-
private
void
timer1_Tick(
object
sender, EventArgs e) {
-
progressBar1.Increment(5);
-
if
(progressBar1.Value == progressBar1.Maximum) {
-
timer1.Stop();
-
}
-
label1.Text = progressBar1.Minimum.ToString();
-
label2.Text = progressBar1.Value.ToString();
-
}
-
}
}
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows.Forms;
namespace
_0055 {
-
public
partial
class
Form1 : Form {
-
public
Form1() {
-
InitializeComponent();
-
}
-
//кнопка Start
-
private
void
button1Start_Click(
object
sender, EventArgs e) {
-
timer1.Start();
-
}
-
//кнопка Clear
-
private
void
button2Clear_Click(
object
sender, EventArgs e) {
-
progressBar1.Value = 0;
-
label1.Text =
string
.Empty;
-
label2.Text =
string
.Empty;
-
}
-
//таймер
-
private
void
timer1_Tick(
object
sender, EventArgs e) {
-
progressBar1.Increment(5);
-
if
(progressBar1.Value == progressBar1.Maximum) {
-
timer1.Stop();
-
}
-
label1.Text = progressBar1.Minimum.ToString();
-
label2.Text = progressBar1.Value.ToString();
-
}
-
}
}