コード例 #1
0
 /// <summary>
 /// Sets the 'Value' property of a given control.  An exception will be thrown if the control does not expose a property called 'Value'.
 /// </summary>
 /// <param name="ctrl">The System.Windows.Forms.Control object whose Value property will be set.</param>
 /// <param name="value">The System.Object value to assign to the property.</param>
 public static void SetValue(Control ctrl, object value)
 {
     try
     { CrossThreadUI.SetPropertyValue(ctrl, "Value", value); }
     catch { throw; }
 }
コード例 #2
0
 /// <summary>
 /// Sets the 'Checked' property of a given control.  An exception will be thrown if the control does not expose a property called 'Checked'.
 /// </summary>
 /// <param name="ctrl">The System.Windows.Forms.Control object whose checked property will be set.</param>
 /// <param name="value">The Sytem.Boolean value to assign to the property.</param>
 public static void SetChecked(Control ctrl, bool value)
 {
     try
     { CrossThreadUI.SetPropertyValue(ctrl, "Checked", value); }
     catch { throw; }
 }