Andrew
Andrew

Reputation: 552

Transparent overlay over WebBrowser control c#

The following picture represents a panel over a WebBrowser control in c#.

enter image description here

However, if i put the panels background property to 'transparent', it will show the color 'Silver' as my form's background is silver.

My question is; how can I draw a overlay over my custom WebBrowser control so that when it is 'transparent', it will show the WebBrowser control instead of the form's background color.

Thanks.

Upvotes: 1

Views: 2454

Answers (1)

Sayse
Sayse

Reputation: 43300

I believe it comes down to the OnPaint methods of panels.

Where there are multiple controls overlapping each other only the top control is drawn for that area of the screen. By making the control transparent, you are making that area of the screen the forms background colour

I believe this question has some suggestions on solutions; this question seems to point towards the OnPaintBackground more specifically also

Question link

Upvotes: 1

Related Questions