I have a series of buttons which I enable and disable programmatically for various reasons. I was unhappy with the default appearance of a disabled button. So I modified my code to also change the BackColor when it disables a button. This works, but now the button has a thick grey border when it is disabled. I tried changing the BorderColor and the Border size, but this has no effect. How can I get rid of the border?
this.EditButton.Enabled = false;
this.EditButton.BackColor = ColorTranslator.FromHtml(ControlColours.DisabledButtonBackColour);
this.EditButton.BorderColor = ColorTranslator.FromHtml(ControlColours.DisabledButtonBackColour);
this.EditButton.FlatAppearance.BorderSize=0;
Instead of
this.EditButton.BorderColor = ColorTranslator.FromHtml(ControlColours.DisabledButtonBackColour);
this one
this.EditButton.FlatStyle = FlatStyle.Flat;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With