TODO stopper

main
szabomarton 2 months ago
parent a2430c2cd9
commit b6df6a1a66

@ -35,11 +35,14 @@ namespace WindowsFormsApp1
this.label1 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.timer2 = new System.Windows.Forms.Timer(this.components);
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(197, 262);
this.button1.Location = new System.Drawing.Point(50, 355);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
@ -49,7 +52,7 @@ namespace WindowsFormsApp1
//
// button2
//
this.button2.Location = new System.Drawing.Point(421, 261);
this.button2.Location = new System.Drawing.Point(232, 355);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 1;
@ -60,7 +63,7 @@ namespace WindowsFormsApp1
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(297, 191);
this.label1.Location = new System.Drawing.Point(181, 81);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(0, 13);
this.label1.TabIndex = 2;
@ -74,17 +77,40 @@ namespace WindowsFormsApp1
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(395, 184);
this.textBox1.Location = new System.Drawing.Point(128, 106);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 3;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(128, 147);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 20);
this.textBox2.TabIndex = 4;
this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
//
// timer2
//
this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(161, 190);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(0, 13);
this.label2.TabIndex = 5;
this.label2.Click += new System.EventHandler(this.label2_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.ClientSize = new System.Drawing.Size(362, 450);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.button2);
@ -104,6 +130,9 @@ namespace WindowsFormsApp1
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Timer timer2;
private System.Windows.Forms.Label label2;
}
}

@ -10,11 +10,16 @@ using System.Windows.Forms;
namespace WindowsFormsApp1
{
public static class Data
{
public static List<TimeSpan> idok = new List<TimeSpan>();
}
public partial class Form1 : Form
{
DateTime start = new DateTime();
DateTime stop = new DateTime();
TimeSpan duration = new TimeSpan();
TimeSpan currSpan = new TimeSpan();
public Form1()
{
InitializeComponent();
@ -22,7 +27,7 @@ namespace WindowsFormsApp1
private void Form1_Load(object sender, EventArgs e)
{
InitTimer();
}
private void button1_Click(object sender, EventArgs e)
@ -30,6 +35,8 @@ namespace WindowsFormsApp1
start = DateTime.Now;
timer1.Enabled = true;
button1.Enabled = false;
timer2.Start();
}
private void button2_Click(object sender, EventArgs e)
@ -40,6 +47,18 @@ namespace WindowsFormsApp1
timer1.Enabled = false;
button1.Enabled = true;
timer2.Stop();
Data.idok.Append(currSpan);
label2.Text = "";
foreach (var item in Data.idok)
{
string asd = item.ToString();
label2.Text = label2.Text + asd;
}
}
private void label1_Click(object sender, EventArgs e)
@ -51,5 +70,29 @@ namespace WindowsFormsApp1
{
textBox1.Text = DateTime.Now.ToString("HH:mm:ss:fff");
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void timer2_Tick(object sender, EventArgs e)
{
currSpan = DateTime.Now - start;
textBox2.Text = currSpan.ToString();
}
public void InitTimer()
{
timer1 = new Timer();
timer1.Tick += new EventHandler(timer2_Tick);
timer1.Interval = 10; // in miliseconds
}
private void label2_Click(object sender, EventArgs e)
{
}
}
}

@ -120,4 +120,7 @@
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="timer2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>104, 17</value>
</metadata>
</root>

@ -8,3 +8,13 @@ C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsForms
C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache
C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe
C:\Users\szabomarton\Desktop\C#\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe.config
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.AssemblyReference.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Properties.Resources.resources
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.GenerateResource.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240311\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Data.resources

Loading…
Cancel
Save