added orai, TODO: stopwatch
This commit is contained in:
55
20240311/WindowsFormsApp1/Form1.cs
Normal file
55
20240311/WindowsFormsApp1/Form1.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
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 WindowsFormsApp1
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
DateTime start = new DateTime();
|
||||
DateTime stop = new DateTime();
|
||||
TimeSpan duration = new TimeSpan();
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
start = DateTime.Now;
|
||||
timer1.Enabled = true;
|
||||
button1.Enabled = false;
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
stop = DateTime.Now;
|
||||
duration = stop - start;
|
||||
label1.Text = duration.ToString();
|
||||
|
||||
timer1.Enabled = false;
|
||||
button1.Enabled = true;
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void textBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
textBox1.Text = DateTime.Now.ToString("HH:mm:ss:fff");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user