Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Icon button layout in winform

I'm working on Windows 8, VS 2012. I added a round icon to my button:

this.btn.Image = Properties.Resources.icon;
this.btn.Size = Properties.Resources.icon.Size;

Also my form has background image:

this.BackgroundImage = Properties.Resources.sunset;

But I'm getting ugly form, where my icon button is square: the round image in the middle and gray color in the corners.

The question is how can I display form background instead of gray color?

enter image description here

Thank you for your attention

like image 413
Eucalyptus Avatar asked Oct 06 '15 07:10

Eucalyptus


1 Answers

You can set some property of your button to gain what you need:

  • Change FlatStyle property of your button to Flat
  • Set its BackColor property to Transparent
  • In FlatAppearance Set BorderSize to 0.
  • In FlatAppearance You can also set MouseDownBackColor and MouseOverBackColor to back color of form or the color you want.

enter image description here

like image 91
Reza Aghaei Avatar answered Oct 01 '22 23:10

Reza Aghaei