Carlo Goretti
Carlo Goretti

Reputation: 47

Can't change the whole background color for a button

I can't change the whole background color for a button. I change it in the properties.

Does someone know how to fix this?

Klick this link to see a picture of this problem

Upvotes: 0

Views: 2269

Answers (3)

Dor Lugasi-Gal
Dor Lugasi-Gal

Reputation: 1572

that's because of the button's flat style, change the FlatStyle to Flat,

and in FlatAppearence change BorderSize to 0 to get rid of the border

enter image description here

Upvotes: 0

Coops
Coops

Reputation: 301

Alter the properties highlighted:

enter image description here

It will give you a button like this (I had mine red):

enter image description here

Upvotes: 4

roozbeh S
roozbeh S

Reputation: 1124

You should set a combination of properties:

this.button1.BackColor = System.Drawing.Color.Red;
this.button1.FlatAppearance.BorderSize = 0;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.UseVisualStyleBackColor = false;

and you'll get this:

enter image description here

Upvotes: 0

Related Questions