I'm working on a typing test program for fun and practice coding, and I figured the easiest thing to do first would be to get the counter out of the way. This doesn't at all seem to be 60 seconds like I want it to be, I think it's too short a time, however the counter does go down, so that is a plus. I've never actually worked with the timer in windows forms at all, so I've got a lot to explore.
namespace Countdown
{
public partial class Form1 : Form
{
int s = 60;
public Form1()
{
InitializeComponent();
label1.Text = s.ToString();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
s -= 1;
if(s == 0)
{
timer1.Stop();
button1.Enabled = false;
textBox1.Enabled = false;
}
string ss = Convert.ToString(s);
label1.Text = ss;
}
}