How to change text in a textbox on another form in Visual C#?

后端 未结 7 2018
抹茶落季
抹茶落季 2020-12-02 01:30

In Visual C# when I click a button, I want to load another form. But before that form loads, I want to fill the textboxes with some text. I tried to put some commands to d

7条回答
  •  旧时难觅i
    2020-12-02 01:38

    Try this.. :)

    Form1 f1 = (Form1)Application.OpenForms["Form1"];
    TextBox tb = (TextBox)f1.Controls["TextBox1"];
    tb.Text = "Value";
    

提交回复
热议问题