user2081191
user2081191

Reputation: 15

Transparent background on form

I have tried many ways to have a transparent background on my form. Transparency key does work, but problems arise when you put images that have opacity. I tried to override OnPaintBackground which only removed my background image. And I tried the SetStyle method.

Upvotes: 0

Views: 1619

Answers (2)

sadegh saati
sadegh saati

Reputation: 1170

You can set opacity of the form.100% is default for Windows form and lower values are more transparent.

Upvotes: 0

eyossi
eyossi

Reputation: 4330

Assuming you are using windows forms, try:

this.TransparencyKey = Color.Red;
this.BackColor = Color.Red;

when you have a color on the form which is the same as your transparency key, then it will be transparent. on the other hand, by that the red color is assigned for transparency only, you won't be able to use it.

(and this refers to the form)

Upvotes: 2

Related Questions