, Visual C#


,


 

53.1. , .

private void button5_Click(object sender, EventArgs e)

{

statusBarPanel1.Text =

System.DateTime.Now.ToShortTimeString();

}

( ) ToShortDateString Start Form3 (. 53.4). Form3.cs , .

53.2. .

private void button6_Click(object sender, EventArgs e)

{

statusBarPanel2.Text =

System.DateTime.Now.ToShortDateString();

}

Start ( , , ToLongTimeString) .

53.3. , .

private void button5_Click(object sender, EventArgs e)

{

statusBarPanel1.Text =

System.DateTime.Now.ToLongTimeString ();

}

53.4. .

private void button6_Click(object sender, EventArgs e)

{

statusBarPanel2.Text =

System.DateTime.Now.ToLongDateString ();

}

53.5. .

private void timer1_Tick(object sender, EventArgs e)

{

statusBarPanel1.Text =

System.DateTime.Now.ToShortTimeString();

statusBarPanel2.Text =

System.DateTime.Now.ToShortDateString();

}

 

53.6. .

private void timer1_Tick(object sender, EventArgs e)

{

statusBarPanel1.Text =

System.DateTime.Now.ToLongTimeString();

statusBarPanel2.Text =

System.DateTime.Now.ToLongDateString();

}

53.7. .

label1.Text = System.DateTime.Now.ToLongTimeString();

label2.Text = System.DateTime.Now.ToLongDateString();

53.8. , .

 

private void timer1_Tick(object sender, EventArgs e)

{

DateTime currentTime = DateTime.Now;

int seconds = currentTime.Second;

int minutes = currentTime.Minute;

int hours = currentTime.Hour;

progressBar1.Value = seconds;

progressBar2.Value = minutes;

progressBar3.Value = hours;

label1.Text = seconds.ToString();

label2.Text = minutes.ToString();

label3.Text = hours.ToString();

}

( ) ( ).