-2

I want to set my form's background to transparent but faced an error "property value is not valid". I don't know if there is a simple way to set a transparent background image as a form in windows?

I'm trying to make a c# windows form application.

I cannot upload a picture yet.For example I want to run my app and see a picture of a book (that doesn't have any white background borders)including tools

pb2q
  • 58,613
  • 19
  • 146
  • 147
mdhr
  • 25
  • 1
  • 3

2 Answers2

4

Here's a code that may help you achieve what you are trying to do. The following code will make the form transparent but leave the controls visible. If you want to hide the controls as well, I suggest you set the form opacity to 0%

this.BackColor = Color.White;
this.TransparencyKey = Color.White;

Thanks,

I hope this helps :)

Picrofo Software
  • 5,475
  • 3
  • 23
  • 37
0

Given that you're using Windows Forms then set the opacity to any value from 0.0 to 1.0. Having 0.0 (complete transparency) and 1.0 (complete opacity).

form.Opacity = 0.0;

MSDN Source: How to create a transparent form.

Erre Efe
  • 15,387
  • 10
  • 45
  • 77