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!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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
AppelhorneAuthor Commented:
Sorry mikal, but your solution doesn't work. No matter how large the number is, it still scrolls by a small amount.
didya check the other sites?

Can you post your code?
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.

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 ""
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AppelhorneAuthor Commented:
Thanks everyone, i have solved the problem!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.