一个静态变量,是经常需要复制的. 两个文本框,一个按钮
在单击事件时,当this.textBox1.Text赋值给textbox2.Text; 常量 Count_A 要锁住不能为textBox1赋值.
 public partial class Form1 : Form
    {
        public static string Count_A = "阿啵次德俄佛格";
        public Form1()
        {
            InitializeComponent();
        }        private void Form1_Load(object sender, EventArgs e)
        {
            Thread th1 = new Thread(new ThreadStart(Run));
            Thread th2 = new Thread(new ThreadStart(Run));
            th1.Name = "线程1";
            th2.Name = "线程2";
            th1.Start();
        }
        /// <summary>
        ///  线程 执行方法 Run 
        /// </summary>
        public void Run() {
           // MessageBox.Show("常量"+Count_A);
            while (string.IsNullOrEmpty(Count_A))
            {
                Monitor.Enter(this);
                MessageBox.Show(Thread.CurrentThread.Name + ": 正在启动 ");
                this.textBox1.Text =Count_A;
             //   this.textBox2.Text = Count_A;    线程异常
                MessageBox.Show("常量:" + Count_A);
                Monitor.Exit(this);
                MessageBox.Show(Thread.CurrentThread.Name +" : 已启动完毕");
            }
        }
      
        private void button1_Click(object sender, EventArgs e)
        {
            
        }