-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form8.cs
54 lines (50 loc) · 1.53 KB
/
Form8.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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 plato_saga
{
public partial class Form8 : Form
{
public Form8()
{
InitializeComponent();
}
int time_record = -1;
private void Form8_Load(object sender, EventArgs e)
{
BackColor = Color.Black;
TransparencyKey = Color.Black;
timer_recorded.Start();
}
private void timer_recorded_Tick(object sender, EventArgs e)
{
new System.Threading.Thread(() =>
{
System.Threading.Thread.CurrentThread.IsBackground = true;
time_record = time_record + 1;
TimeSpan t = TimeSpan.FromSeconds(time_record);
String tx_elapsed = string.Format("{0:D2}h:{1:D2}m:{2:D2}s",
t.Hours,
t.Minutes,
t.Seconds);
this.Invoke(new MethodInvoker(delegate
{
lbl_elapsed.Text = tx_elapsed;
lbl_elapsed.Refresh();
Text = tx_elapsed;
}));
}).Start();
}
private void Form8_FormClosing(object sender, FormClosingEventArgs e)
{
time_record = 0;
timer_recorded.Stop();
}
}
}