how to create a thread
===

when I click  button1 should print A s but when I click button2 need to stop thread1 and need to start thread2, what is the wrong in here please help me

        
        private void button1_Click(object sender, EventArgs e)
        {
            if (thread2.IsAlive)
            {
                thread2.Suspend();
            }
            thread1 = new Thread(threadOne);
            thread1.Start();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (thread1.IsAlive)
            {
                thread1.Suspend();
            }
            thread2 = new Thread(threadTwo);
            thread2.Start();
        }

        private void threadOne() {
            for (int i=0; i < 20; i++ )
            {
                Console.Write("A");
                Thread.Sleep(500);
            }
        }

        private void threadTwo()
        {
            for (int i = 0; i < 20; i++)
            {
                Console.Write("B");
                Thread.Sleep(500);
            }
        }
    
