c#线程

...

public partial class main_form : Form
{
    ...{
            ...
            mysub_thread subclass = new mysub_thread(this);
            subthread = new System.Threading.Thread(new System.Threading.ThreadStart(subclass.run));
            subthread.Start();
    }
    class mysub_thread
    {
        private main_form curForm;

        public mysub_thread(main_form tmpForm)
        {
            this.curForm = tmpForm;
        }
        public void run()
        {
            ...
        }
    }

}

把主form当作参数传递给子线程,以便子线程调用

原文地址:https://www.cnblogs.com/abinxm/p/1511869.html