예제 #1
0
 public static void SetCheckbox(Form form, Control ctrl, bool value)
 {
     if (ctrl.InvokeRequired)
     {
         SetCheckboxCallback d = new SetCheckboxCallback(SetCheckbox);
         form.Invoke(d, new object[] { form, ctrl, value });
     }
     else
     {
         if (ctrl is CheckBox)
         {
             ((CheckBox)ctrl).Checked = value;
         }
     }
 }
예제 #2
0
 private void SetCheckbox(CheckBox ctl, bool val)
 {
     if(ctl.InvokeRequired)
       {
     SetCheckboxCallback d = new SetCheckboxCallback(SetCheckbox);
     this.Invoke(d, new object[] { ctl, val });
       }
       else
       {
     ctl.Checked = val;
       }
 }