Results 1 to 4 of 4

Thread: Resize webbrowser control to size of web page?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    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!

  2. #2
    New Member
    Join Date
    Nov 2006
    Posts
    12

    Re: Resize webbrowser control to size of web page?

    try this

    VB Code:
    1. Private Sub Form_Load()
    2.  
    3.  
    4.     Form_Resize
    5.  
    6.     cboAddress.Move 50, lblAddress.Top + lblAddress.Height + 15
    7.  
    8. End Sub
    VB Code:
    1. Private Sub Form_Resize()
    2.     On Error Resume Next
    3.     cboAddress.Width = Me.ScaleWidth - 100
    4.     brwWebBrowser.Width = Me.ScaleWidth - 100
    5.     brwWebBrowser.Height = Me.ScaleHeight - (picAddress.Top + picAddress.Height) - 100
    6. End Sub

    make sure your browser has the same name

  3. #3
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    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...

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width