Loading DOC in WebBrowser control 
Author Message
 Loading DOC in WebBrowser control

Is there any way to force an HTML doc loaded into the WebBrowser control to
NOT have any space on the top and left? The initial window of my app is
really a borderless form with a WebBrowser control displaying a web page
that consists of a single graphic that makes up the initial window. But the
after I load the doc into the control the graphic has unwanted space on all
sides. This has the effect of pushing the graphic to the right as the
control shows all of the white space beside the graphic on the left. So the
graphic is clipped on the right. How does one prevent this from happening? I
simply wish the graphic to fill the WebBrowser control from border to
border. This means the control should be almost exactly the same dimensions
as the graphic to be displayed. But if I set the height and width properties
to match the graphic then the graphic is clipped due to the white
space --which is not coded in the HTML doc. Err. Is there a way around this?

Thanks!

BB



Mon, 10 Oct 2005 13:14:33 GMT  
 Loading DOC in WebBrowser control

Quote:
> Is there any way to force an HTML doc loaded into the WebBrowser control to
> NOT have any space on the top and left? The initial window of my app is
> really a borderless form with a WebBrowser control displaying a web page
> that consists of a single graphic that makes up the initial window.

Be sure that page includes code to set the margins of the BODY object:

<HTML>
<BODY STYLE="margin:0px 0px;">
<IMG SRC="MyImage.Gif"/>
</BODY>
</HTML>

LFS



Mon, 10 Oct 2005 15:05:34 GMT  
 Loading DOC in WebBrowser control
Thanks Larry, that worked great!

BB


Quote:

> > Is there any way to force an HTML doc loaded into the WebBrowser control
to
> > NOT have any space on the top and left? The initial window of my app is
> > really a borderless form with a WebBrowser control displaying a web page
> > that consists of a single graphic that makes up the initial window.

> Be sure that page includes code to set the margins of the BODY object:

> <HTML>
> <BODY STYLE="margin:0px 0px;">
> <IMG SRC="MyImage.Gif"/>
> </BODY>
> </HTML>

> LFS



Mon, 10 Oct 2005 15:45:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Loading DOC in WebBrowser control

2. Load and Parse HTML Doc without WebBrowser Control

3. programmatically controlling header/footer on doc printed from WebBrowser control

4. Using WebBrowser control load URL in a separate Browser OR any other control

5. WebBrowser control browsing to an Anchor in an HTML doc

6. How to reference word doc in Webbrowser control?

7. ActX Doc and webbrowser control problem

8. GetObject() crashes when loading a word doc containing an ActiveX control

9. vb webbrowser control,how to know it is complete loading

10. vb webbrowser control,how to know it is complete loading

11. vb webbrowser control,how to know it is complete loading

12. Load Webbrowser control from memory instead of file?

 

 
Powered by phpBB® Forum Software