public void SetButtonVisible(Button btPassButton, bool bVisible) { if (btPassButton.InvokeRequired) { SetButtonVisibleCallback d = new SetButtonVisibleCallback(SetButtonVisible); this.Invoke(d, new object[] { btPassButton, bVisible }); } else { btPassButton.Visible = bVisible; } }
private void ButtonVisibility(Button btn, bool visiblity) { if (btn.InvokeRequired) { SetButtonVisibleCallback d = new SetButtonVisibleCallback(ButtonVisibility); tv.Invoke(d, new object[] { btn, visiblity }); } else { btn.Visible = visiblity; } }