There are many ways to do that. Here are some examples:
You can declare a public static method on the first form that sets a static class attribute and call the method from the second form. Something like this:
##### Form that receive values
- public partial class Form2 : Form
-
{
-
static string name { get; set; }
-
public Form2()
-
{
-
InitializeComponent();
-
}
-
public static void setName(string pName)
-
{
-
name = pName;
-
}
-
}
-
##### Form that send values
-
-
public partial class Form1 : Form
-
{
-
public Form1()
-
{
-
InitializeComponent();
-
}
-
-
private void button1_Click(object sender, EventArgs e)
-
{
-
Form2.setName("Sfreak");
-
}
-
}
Or you pass the instance of the form that will receive the values to the one that will send values to control it using methods with referenced parameters.
Better than this you can implement an Observer pattern that manages the first form using an Interface between them.