1

I got into a problem. I downloaded a photo without a background PNG file and I used the image inside the button. And I want to make that photo transparent so I don't have that squares in the button. So I want to set transparent background for the image.

Here's an image:

enter image description here

founderio
  • 407
  • 1
  • 3
  • 15
  • 1
    Hi Andrei, I think your transparent image is not actually transparent, as I don't think these squares should appear in Windows Forms. you'll need to manually erase the transparent squares yourself (Don't use MS Paint, as that doesn't support transparency), or find a different texture with an actual transparent background. – Steven Nov 22 '21 at 07:55
  • I think you are creating the UI and when you insert (or attach) the image, it just shows those gray and white squares. Try running the UI and see if you still see those squares. – kiner_shah Nov 22 '21 at 07:57
  • This might be the solution which can help you out: (https://stackoverflow.com/questions/4416934/c-how-to-make-a-picture-background-transparent) – MysteryTech443 Nov 22 '21 at 08:00
  • 3
    Welcome to SO. Please write question titles that describe the problem. People want to know what question you have, not how long you're programming or what project you do. I changed it now for you. – jps Nov 22 '21 at 08:02
  • @Myst: The link suggests that picturebox can't properly display a png with transparency. Not sure if that was true 20 years ago but it certainly is not true today. The answer ought o be deleted or at least maeked as outdated. – TaW Nov 22 '21 at 09:31

1 Answers1

1
  • First make your button background color transparent and add your image.
  • After that Flatstyle = flat

Button Settings

Example

kiner_shah
  • 3,939
  • 7
  • 23
  • 37