Reputation: 552
The following picture represents a panel over a WebBrowser control in c#.
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
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
Upvotes: 1