Results 1 to 4 of 4

Thread: Scroll A Web Browser Control To The End Of The Document? [Solved]

  1. #1

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    Scroll A Web Browser Control To The End Of The Document? [Solved]

    Hey ya, i know i can scroll a web browser document to the end by using:

    VB Code:
    1. brwMessage.SetFocus
    2. SendKeys "^{END}"

    BUT: is there a way to do this WITHOUT having to set focus onto the browser?, because i really dont want the focus to b lost on other forms / applications when this happens....

    ne how, thanks
    Wayne
    Last edited by wpearsall; Apr 8th, 2003 at 07:46 PM.
    Wayne

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    Use the ScrollTo method of the parentWindow for the Document, i.e.
    VB Code:
    1. With WebBrowser1.Document.parentWindow
    2.     Call .ScrollTo(0, .Screen.AvailHeight)
    3.   End With

  3. #3

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    hey,,, cool, this works better then the SendKeys method did

    for some reason, the form is still taking over the focus, but it may just be i added some code elsewhere in my application

    thanks
    Wayne
    Wayne

  4. #4

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    OK: Jst searched for .setfocus, and yup, right after i called the sub to write to the web browser, i add the set focus on the web browser control

    Thanks
    Wayne

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