0
votes

Since the WebBrowser control doesn't allow transparent backgrounds I'm trying to set the background in the WebBrowser control.

I've tried modifying the HTML before calling NavigateToString(), but since the html is a string in memory, I'm not sure what the path should be for my image

Trying this doesn't work:

body { background-image:url('/Images/texture.jpg'); }

Does anybody know if this is possible, or what path I should be using?

3

3 Answers

1
votes

Any paths need to be absolute paths to files on the Internet or relative paths to content in IsolatedStorage.

0
votes

Try setting WebBrowser.Base appropriatelly, it sets the 'root directory' for a webbrowser that displays local or generated contents

0
votes

try full image path like this

body { background-image:url('C:/Images/texture.jpg'); }

and this winform Webbrowser

    webBrowser1.Document.Write("<BODY background= D:\\Desktop\\123.jpg bgColor=#ffffff text=#000000>");