简单委托:在主窗口F1点击菜单打开另一个子窗口F2时,将主窗口textBox传至子窗口的textBox 主窗体F1写代码: int autoid = Convert.ToInt32(txtEditAutoId.Text.Trim()); DZD_Input dzd = new DZD_Input(autoid); dzd.Show(); 子窗体F2写代码: public DZD_I
简单委托:在主窗口F1点击菜单打开另一个子窗口F2时,将主窗口textBox值传至子窗口的textBox值
主窗体F1写代码:
int autoid = Convert.ToInt32(txtEditAutoId.Text.Trim());
DZD_Input dzd = new DZD_Input(autoid);
dzd.Show();
子窗体F2写代码:
public DZD_Input(int autoid)
:this()
{
this.txtEditAutoId.Text = autoid.ToString();
}