All pastes #839381 Raw Edit

Stuff

public text v1 · immutable
#839381 ·published 2007-12-31 00:15 UTC
rendered paste body
public Form1 : Form
{
   private CheckBox checkBox1;

   public bool CheckBoxState
   {
      get {return checkBox1.Checked;}
      set {checkBox1.Checked = value;}
   }

   public Form1()
   {
      ...
      Form2 frm2 = new Form2(this);
   }
}

public Form2 : Form
{
   private Form frm1;

   public Form2(Form frm)
   {
      ...
      frm1 = frm;
      
      // check the checkBox in Form1
      if (frm1.CheckBoxState == false)
      {
         frm1.CheckBoxState = true;
      }
   }
}