/// <summary>
/// Safely set the <see cref="CheckBox.Checked"/> of the CheckBox across threads.
/// </summary>
/// <param name="control"></param>
/// <param name="value"></param>
public static void Checked( this CheckBox control, Boolean value ) {
if ( null == control ) {
return;
}
if ( control.InvokeRequired ) {
control.BeginInvoke( new Action( () => {
control.Checked = value;
control.Refresh();
} ) );
}
else {
control.Checked = value;
control.Refresh();
}
}
No comments:
Post a Comment