本帖最后由 linyan 于 2020-1-29 11:38 编辑
解决的方法:
1、在主窗体:
public string UserName;//公用变量
public void ShowName() //公用方法
{
textBox1.Text = textBox1.Text + UserName;
}
2、在主窗体的控件:
((SmobilerForm14)this.Form).UserName = "@" + this.label3.Text;//调用公用变量
((SmobilerForm14)this.Form).ShowName();//调用公用方法
3、结果:
控件窗体通过 UserName 公用变量传值到主窗体的 textBox1.Text 中。 |