views:

209

answers:

1

Hi all.

I try to make my WebBrowser control transparent, so if the HTML loaded into it has no background, the underlying window should be visible. I`ve broke my head trying different ways.

There is a transparent background in Microsoft Sidebar application. In gadget`s HTML <g:background> tag can be used, but this tag is not available in usual webBrowser control.

I`ve also investigate in DirectX Transform filters, which can be applied to the HTML elements in IE, but have no success.

Any help would be greatly appreciated.

+1  A: 

WebBrowser (aka Internet Explorer) has no such capabilities. You'd have to host it in a window that uses the WS_EX_LAYERED style flag and use SetLayeredWindowAttributes() to make the color key match the background of the displayed HTML. Avoid displaying any text, it is going to look bad when the anti-aliasing pixels no longer blend the letter with the background.

Hans Passant