zoukankan      html  css  js  c++  java
  • 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();
                    }
    }
  • 相关阅读:
    概念辨析:Spring中@AutoWired和@Bean的区别
    打牢基础知识,避免采坑
    golang服务端编程
    如何避免写bug的一些实例和技巧
    常见数学问题的解题思路
    App开发需要了解的基本技术
    vue项目webpack打包
    vue项目中使用lottie动画
    js函数-参数默认值
    powershell操作excel
  • 原文地址:https://www.cnblogs.com/lijinchang/p/1872483.html
Copyright © 2011-2022 走看看