Winform子窗体关闭给父窗体传值

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/m0_37137902/article/details/79816699
 //父窗体
   private void btnAdd_Click(object sender, EventArgs e)
        {
            FormAddHotKey m_FormAddKey = new MyAutomaticTextInput.FormAddHotKey();
            m_FormAddKey.Owner = this;
            m_FormAddKey.ShowDialog();
        }
//子窗体
   private void btn_OK_Click(object sender, EventArgs e)
        {
           
            FormAutomaticTextInput m_FormAutomaticTextInput = (FormAutomaticTextInput)this.Owner;           
            m_FormAutomaticTextInput.label2.Text = "123";         
            this.Close();
        }

 

展开阅读全文

没有更多推荐了,返回首页