// Update the visibility of a control private void updateControlVisibility(Control control, Boolean onNotOff) { if (!control.IsDisposed) { if (control.InvokeRequired) { SetControlVisibilityCallback update = new SetControlVisibilityCallback(_updateControlVisibility); control.Invoke(update, new object[] { control, onNotOff }); } else { _updateControlVisibility(control, onNotOff); } } }
// Update the visibility of a control on the form private void updateControlVisibility(Control control, Boolean onNotOff) { if (control.InvokeRequired) { SetControlVisibilityCallback update = new SetControlVisibilityCallback(_updateControlVisibility); control.Invoke(update, new object[] { control, onNotOff }); } else { _updateControlVisibility(control, onNotOff); } }