Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Webbrowser control sizing 1

Status
Not open for further replies.

mcelligott

Programmer
Apr 17, 2002
135
US
Hi all,

I have the following webpage ( appear on a form within my database. Unfortunately I have to fit other fields onto the form as well. Although I can resize the webbrowser object size, I need the web site to fit the width within the webbrowser object (4.8") or make the right side of the webpage the default display. The length is not a concern. Is anyone aware of how this can be accomplished?

Thank you in advance for any assistance you could offer.

Bob
 
Code:
Private Sub WebBrowser3_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    Dim MaxScrollX
    MaxScrollX = WebBrowser3.Document.body.scrollWidth
    WebBrowser3.Document.parentWindow.scrollTo MaxScrollX / 2, 0
End Sub
to scroll halfway down
Code:
    Dim MaxScrollY
    MaxScrollY = WebBrowser3.Document.body.scrollHeight
    WebBrowser3.Document.parentWindow.scrollTo 0, MaxScrollY / 2

This is from an old post in VB6 Forum by "strongm"

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Hi Zameer,

Thank you for responding so quickly. I admit I think what you sent me is a bit beyond me. I have the following code that runs when the form opens, should the code you sent be added to this? And are there any parts that need to be modified?

Private Sub Form_Open(Cancel As Integer)

DoCmd.Maximize
WebBrowser3.Navigate "
End Sub

Also, does the code you sent, make it fit within the object or just make it move it to the right? If it only makes it move to the right, the page refreshes on a regular basis I will need to account for that as well.

Thank you again for any help you can offer. I know I sound like a moron. I am not normally this dense.

Bob
 
The code I have posted will make to move show the right side of the page. It will only act after the page loaded completely. So it will do it's action after every refresh.
Try pasting the code to the code window.


________________________________________________________
Zameer Abdulla
Help to find Missing people
 
That is exactly what I am looking for thank you very much. It works perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top