在form1的程序里控制form2的label.text
也就是在form1的按个命令按钮,出现form2界面,并form2的label要显示我所要的text

解决方案 »

  1.   

    可以在form2的构造函数里加个参数public Form2(string str)
    {
     ……
     label1.Text=str;
    }form1单击按钮时
    Form2 frm=new Form2("中华人民共和国");
    frm.Show();
      

  2.   

    from1里:from2 f2=new form2();
    f2.Controls["lable1"].text;lable1为控件名。
      

  3.   

     将frm2实例化,用ui.controls 控制frm1传过来的参数就可以显示了。
      

  4.   

    可以给form2 添加一个属性
    把一下代码添加到form2中:public string LText
    {
        get{return lable1.Text;}
        set{lable1.Text = value;}
    }然后再form1的按钮事件里面添加如下代码:
    from2   f2=new   form2(); 
    f2.LText = 你想要的值;
      

  5.   

    在 form2的界面上有个laibel1控件   猫是我还没试出来