小弟用了两个线程,分别计数,显示在textBox1和richTextBox1中,运行之后发现还是一个框先计数到9之后,另一个才从0开始计数,怎么能实现两个线程同时计数呢?请高手指点一下using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;namespace WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }        
        
        private void Form1_Load(object sender, EventArgs e)
        {
           Thread  newthread = new Thread(new ThreadStart(tthread));
           newthread.Start();
           Thread twothread = new Thread(new ThreadStart(thread_2));
           twothread.Start();
        }        private void thread_2()
        {
            dc dc_2 = new dc(fun2);
            this.textBox1.Invoke(dc_2);
        }        private void fun2()
        {
            for (int i = 0; i < 10; i++)
            {
                textBox1.Text = Convert.ToString(i);
                textBox1.Refresh();
                Thread.Sleep(1000);
            }
        }        private void tthread()
        {
            dc dc_fun = new dc(fun);
            this.richTextBox1.Invoke(dc_fun);
        }
        delegate void dc();        private void fun()
        {
            for (int i = 0; i < 10; i++)
            {
                richTextBox1.Text = Convert.ToString(i);
                richTextBox1.Refresh();
                Thread.Sleep(500);
            }
        } 
    }
}