winform 利用属性在父、子窗体间传值

父窗口:
public   partial     class   wc_DanChen   :   Form
        {
                public   int   userID;
                public   wc_DanChen()
                {
                        InitializeComponent();
                }
                private   void   Form1_Load(object   sender,   EventArgs   e)
                {
                        wc_NewYard   NewForm   =   new   wc_NewYard(this);          
                        NewForm.show();
                }
}

子窗口
public   partial   class   wc_NewRoll   :   Form
        {
                private   wc_NewYard   frmParent;

                public   wc_NewRoll(wc_NewYard   parent)
                {
                        InitializeComponent();
                        frmParent   =   parent;
                }
                private   void   button3_Click(object   sender,   EventArgs   e)
                {
                        frmParent.userID   =   " ";
                        this.close();
                }
}
原文地址:https://www.cnblogs.com/lijinchang/p/1872483.html