public void SetButtonColor(Button btPassButton, Color cPassColor) { if (btPassButton.InvokeRequired) { SetButtonColorCallback d = new SetButtonColorCallback(SetButtonColor); this.Invoke(d, new object[] { btPassButton, cPassColor }); } else { btPassButton.BackColor = cPassColor; btPassButton.FlatAppearance.MouseOverBackColor = cPassColor; } }
private void SetButtonColor(Color theColor, bool forground, Button theButton) { if (theButton.InvokeRequired) { SetButtonColorCallback d = new SetButtonColorCallback(SetButtonColor); this.Invoke(d, new object[] { theColor, forground, theButton }); } else { if(forground) theButton.ForeColor = theColor; else theButton.BackColor = theColor; } }