StatusStrip — это статус бар.


Наиболее удобно добавлять элементы управления в контейнер StatusStrip и редактировать с помощью свойства Items, нажав на кнопку, откроется редактор.

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
_0066 {
-
public
partial
class
Form1 : Form {
-
public
Form1() {
-
InitializeComponent();
-
timer1.Start();
-
timer2.Start();
-
}
-
private
void
timer1_Tick(
object
sender, EventArgs e) {
-
toolStripStatusLabel1.Text =
string
.Format(
"{0:F}"
, DateTime.Now);
-
}
-
private
void
timer2_Tick(
object
sender, EventArgs e) {
-
toolStripProgressBar1.Increment(1);
-
if
(toolStripProgressBar1.Value == toolStripProgressBar1.Maximum) {
-
timer2.Stop();
-
}
-
}
-
}
}
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
_0066 {
-
public
partial
class
Form1 : Form {
-
public
Form1() {
-
InitializeComponent();
-
timer1.Start();
-
timer2.Start();
-
}
-
private
void
timer1_Tick(
object
sender, EventArgs e) {
-
toolStripStatusLabel1.Text =
string
.Format(
"{0:F}"
, DateTime.Now);
-
}
-
private
void
timer2_Tick(
object
sender, EventArgs e) {
-
toolStripProgressBar1.Increment(1);
-
if
(toolStripProgressBar1.Value == toolStripProgressBar1.Maximum) {
-
timer2.Stop();
-
}
-
}
-
}
}
