• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

Microsoft Internet Controls

Is it possible to scroll a site in a webbrowser in visual basic? I am making a chat program and i use the webbrowser control for the chatscreen. So when somebody says something it has to scroll to the bottom.

Thanks in advance!
0
Appelhorne
Asked:
Appelhorne
  • 7
  • 2
2 Solutions
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Mikal613Commented:
WebBrowser.Document.parentWindow.scroll 0, 30000

The 30000 specifies how far to scroll in the Y direction.  If you just make this a very large number, it should accomdate any loaded document regardless of the document's height
0
 
AppelhorneAuthor Commented:
Sorry mikal, but your solution doesn't work. No matter how large the number is, it still scrolls by a small amount.
0
 
Mikal613Commented:
didya check the other sites?

Can you post your code?
0
 
Mikal613Commented:
0
 
zzzzzoocCommented:
scrollTo() the height of the body's scrollbar and it'll go directly to the bottom. This'll avoid using some extremely high value. If you have an element that has a scrollbar (such as a DIV with overflow.. like Yahoo! Messenger), you'll have to scroll that element instead.


Form1:
-------------
Private Sub Command1_Click()
    Dim objDoc As Object
    Set objDoc = WebBrowser1.Document
    objDoc.parentWindow.scrollTo 0, objDoc.body.scrollHeight
End Sub
Private Sub Form_Load()
    WebBrowser1.Navigate "www.yahoo.com"
End Sub
0
 
AppelhorneAuthor Commented:
Thanks everyone, i have solved the problem!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now