Answer the question
In order to leave comments, you need to log in
How to establish communication between Forms?
private void button2_Click(object sender, EventArgs e)
{
Close();
Form1.textBox1.Text = "";
Form1.textBox2.Text = "";
Form1.textBox3.Text = "";
}
From Form2 I can't access textBox1 from Form1, writes "inaccessible due to its protection level".
I can't find a solution at all.
Answer the question
In order to leave comments, you need to log in
The controls in the designer have a Modifiers property, you can set it to public if you really need to.
But most likely you are doing something strange and wrong. Read better about OOP, encapsulation and all that.
And give the controls normal names, not textbox999 and button85.
Describe for Form1 public setters for required Form1.textBox.Text
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question