Use Databinding and an object to pass around. The following example demonstrates how to achieve this without having to make anything static. Because the values become bound together if you do: state.IsChecked = false; that would also uncheck the checkbox on Form2.
Don't just add global variables, that's a large pain waiting to happen.
class Form1: Form
{
private State state = new State();
public Form1()
{
Load += HandleLoad;
}
public HandleLoad(object sender, EventArgs e)
{
label1.DataBindings.Add("Text", state, "IsChecked"); // or just query state.IsChecked
}
public void someEvent_Handler()
{
Form2 form2 = new Form2();
form2.Bind(state);
form2.Show();
}
}
class Form2: Form
{
public void Bind(State state)
{
checkBox1.DataBindings.Add("Checked", state, "IsChecked");
}
}
class State
{
public bool IsChecked {get;set;}
}