你写一段等待键盘的代码,并写入注册表,在创建form的时候,让进程调用注册表

解决方案 »

  1.   

    可以考虑放在Timer控件的Tick事件中
      

  2.   

    form1里
    Form2 f2 = new Form2();
                f2.Show(this);
                tr = new Thread(new ThreadStart(f2.function1));
                tr.Start();
    form2里 
           private void Form2_FormClosing(object sender, FormClosingEventArgs e)
            {
                Form1 f1 = (Form1)this.Owner;
                f1.tr.Abort();
            }
            public void function1()
            { 
               MessageBox.Show("asdf"); 
            }