Resize webbrowser control to size of web page?
Is there any way the webbrowser control can be resized to the web page so there are no scroll bars?
What I am trying to do it resize the webbrowser control to the size of the web page and the webbrowser control is in a picturebox control. Then I am going to use some code I found that captures and saved the picturebox and the contents to an image file. This way I have the whole web page saved as an image.
Any suggestions?
Thanks!
Re: Resize webbrowser control to size of web page?
try this
VB Code:
Private Sub Form_Load()
Form_Resize
cboAddress.Move 50, lblAddress.Top + lblAddress.Height + 15
End Sub
VB Code:
Private Sub Form_Resize()
On Error Resume Next
cboAddress.Width = Me.ScaleWidth - 100
brwWebBrowser.Width = Me.ScaleWidth - 100
brwWebBrowser.Height = Me.ScaleHeight - (picAddress.Top + picAddress.Height) - 100
End Sub
make sure your browser has the same name
Re: Resize webbrowser control to size of web page?
I believe WebBrowser doesn't have any Width and Height property, talking about the .Document of course, not the control...
Re: Resize webbrowser control to size of web page?
I wish I could read the position of the scroll bar in the webbrowser control because then after the web page loads I would keep adjusting the height until there was no scroll bar and that would be it right there.