What the above poster is probably the better way of doing it, but if you want a quick and dirty way of doing it you can instantiate the other form and change the "Modifier" property of the controls you want to access from "Private" to "Public".
Simple example 1: (Change while Form2 is still open)
first form: (contains a textbox with a public modifier, textBox1)
Code:
Form2 frm2 = new Form2(this);
frm2.ShowDialog(); //You can use Show() if you want both forms to be interactive at once
second form:
Code:
//include statements
private Form1 _f1;
//Constructor takes one instance of Form1
public Form2(Form1 f1)
{
_f1 = f1;
}
private void Form2_Load(object sender, EventArgs e)
{
_f1.textBox1.Text = "Changed from Form2";
}
Simple example 2: (Textbox values change after Form2 is closed. Public modifier controls not necessary since code from first Form is doing the changing)
First Form:
Code:
Form2 frm2 = new Form2();
frm2.ShowDialog();
textBox1.Text = frm2.Sample; //This doesn't trigger until frm2 is closed when using ShowDialog(). If you use Show() it would be set to the initial value, in this case "ABCD"
Second Form:
Code:
public string Sample = "ABCD";
//You can modify the public string however
//Other code
this.Close();
Some part of this could be slightly off but it should work.