Timer Örneği için tıklayınız…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 timer2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int secim=1,sayi=0;
private void button1_Click(object sender, EventArgs e)
{
secim = 1;
}
private void button2_Click(object sender, EventArgs e)
{
secim = 2;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (secim == 1)
{
sayi++;
label1.Text = sayi.ToString();
}
if (secim == 2)
{
sayi–;
label1.Text = sayi.ToString();
}
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
}
}
}