zoukankan      html  css  js  c++  java
  • winform窗体之间的传值

    资料整理结果如下

    1.

    子窗体做一个属性    
      子窗体的确定按钮里面给这个属性赋值   
      父窗体直接访问这个属性就好了

      FrmChoiceProduct FormChild = new FrmChoiceProduct();
                FormChild.Owner = this;
                FormChild.ShowDialog();
                txtWeight.Text = FormChild.strWeight;

    private   string   inputValue   =   "";  
      public   string   InputValue  
      {  
            get{return   inputValue;}  
      }  
       
       
      confirm_buttonClick.....  
      {  
            inputValue=   TextBox1.Text.Trim();  
            this.DialogResult   =   DialogResult.OK;  
      }  
       
       
      父窗体  
       
      childForm   cf   =   new   childForm();  
      string   varReturnValue   =   "";  
      if(cf.ShowDialog()   ==   DialogResult.OK)  
      {  
            varReturnValue     =   cf.InputValue    
      }

  • 相关阅读:
    bzoj3757 苹果树
    bzoj2743 [HEOI2012]采花
    bzoj4241 历史研究
    bzoj4448 [Scoi2015]情报传递
    bzoj3295 [Cqoi2011]动态逆序对
    bzoj4034 [HAOI2015]T2
    bzoj3339 Rmq Problem
    BZOJ 1017 魔兽地图
    BZOJ 1021 循环的债务
    SUOI #37 清点更多船只
  • 原文地址:https://www.cnblogs.com/meetweb/p/1289731.html
Copyright © 2011-2022 走看看