在C#中怎么调用别的窗体的控件属性

比如说 在Form2中调用 Form1中的table1.Text属性该怎样弄

第1个回答  2020-10-27
需求:想在From2中调用From1的 textBox控件的text属性。

实现过程:
1、在From1中将 textBox控件的 Modifiers属性改为public
2、在From2实例化From1:
Form1 from1 = new Form1();
3、调用
if (from1.textBox1 == null)
{
}
相似回答