Transparent Background on WebBrowser Control in WP7?

This is not possible as the WebBrowser control is not a "true" (fully managed) silverlight control, it's essentially just a wrapper of a native control and does not support transparency.

Up vote 1 down vote favorite share g+ share fb share tw.

The reason I'm asking is instead of storing some semi-static text in the app, we are storing it on the web and referencing it from there. (So if we need to do updates, we do not have to update the app) We have transparent controls in iOS and Android, and would like to do it here as well. If you can't do it, can you think of any alternatives?

Windows-phone-7 webbrowser-control link|improve this question asked Sep 12 '11 at 15:29Hosemeyer394310 86% accept rate.

This is not possible as the WebBrowser control is not a "true" (fully managed) silverlight control, it's essentially just a wrapper of a native control and does not support transparency. As an alternative, just get the content/text from the website and display it in controls which do support transparency. Depending on the formatting of the content you are getting from the website will influence how difficult this is.

WrapPanel (from the Toolkit) will likely be a great help for this type of thing.

It's going to be pretty simple text like terms and conditions and so on. – Hosemeyer Sep 12 '11 at 15:37 1 In that case it'll be fairly straight forward. It's formatting which causes issues.

See the HtmlAgilityPack for parsing HTML if need be htmlagilitypack.codeplex.com/SourceContr... – Matt Lacey Sep 12 '11 at 15:43 You should also consider using the RichTextBox for displaying this kind of info. – Paul Annetts Sep 12 '11 at 21:04.

It is a poor man's solution to the problem, but maybe will help you a bit: if you just want the webbrowser's background to match exactly the background color of your application, you may get over the problem just by forcing the page to .. have the same bacground color. Use WebBrowser. InvokeScript and execute a small JS script that will do a document.body.

Background = #rrggbb with your bkgcolor. You may want to try adding 'alpha' but I think that in the best case you will end up with white. Taking this approach a small step further, you may try to screenshot your app, save it, then exec a JS script to set bkgimage of the page.. The bkgimage can be set with CSS to not scroll with the page contents, so it actually might look nice, but I've never tried.

From what I know, the WebBrowser does originally support setting the background, because as Matt said, internally, it is a native component that prepares renders of the html content, and as such, it knows nthing about your application and it simply keeps up to the exact styling that is written into the page. The page has always some background color - ie. White - and so the rendered image has the same.

Very similar "concept" is also present on some another platforms - fore example. RIM/BlackBerry 4. X, 5.

X and I think in 6. X too. Hm, but on the second though, CSS supports not only #RGB but also #RGBA, so the nativehost could emit renderings with appropriate alpha-channel, if only you set the page's body bkg color with alpha.

However I suppose it would still turn white.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions