using System;
using System.Windows.Forms;
using System.Threading;

public partial class CounterThreadApp : Form
{
    private int nThread = 0;

    public CounterThreadApp()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        CounterForm c = new CounterForm(nThread++);
        c.Show();
        Thread thread = new Thread(new ThreadStart(c.Count));
        thread.Start();
    }
}