473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

how to scroll WebBrowser

This page
http://www.codeproject.com/miscctrl/scrollbrowser.asp
claims it can be done like so, in VB (and thus C#, I presume):

m_browser.Document.Body.ScrollTop = 100;

But, this does not work. I've already tried sending WM_VSCROLL with
SB_BOTTOM, and it doesn't work. It must be possible, though.

Zytan

Mar 23 '07 #1
3 21869
Zytan,

Please check this link:
http://www.ben-rush.net/blog/PermaLi...f1a33cfdd.aspx

Let me know if you have any further problems.
--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog

"Zytan" <zy**********@yahoo.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
This page
http://www.codeproject.com/miscctrl/scrollbrowser.asp
claims it can be done like so, in VB (and thus C#, I presume):

m_browser.Document.Body.ScrollTop = 100;

But, this does not work. I've already tried sending WM_VSCROLL with
SB_BOTTOM, and it doesn't work. It must be possible, though.

Zytan

Mar 24 '07 #2
Please check this link:http://www.ben-rush.net/blog/PermaLi...3b-49f5-a351-0...
>
Let me know if you have any further problems.
Ben, thanks for the tip. I actuall figured it out over the weekend:

private void Scroll(WebBrowser webControl)
{
if (webControl.Document != null)
webControl.Document.Body.ScrollTop = int.MaxValue;
}

But, it seems to only work when you do:
webControl.Document.Write(s);
and not when you call this first, like MSDN asks you to:
webControl.Document.OpenNew(true);
this means that Write just appends. Since I'm just making a logger,
that's good enough! Why slow it down by reloading the entire thing,
when I can just append?

Also, to get a Document != null, you need to navigate somewhere first,
I choose about:blank

Zytan

Mar 27 '07 #3
Zytan,
>
Please check this link:http://www.ben-rush.net/blog/PermaLi...3b-49f5-a351-0...

Let me know if you have any further problems.
This method is the same as my method, and it doesn't work if the
webpage contains a DOCTYPE, which a conformant webpage should.
ScrollTop just stops working.

I need another solution, since I need a DOCTYPE so that the browser
knows to render the CSS as it is supposed to be rendered. The CSS
code "white-space:pre;" does not work without it.

Zytan

Mar 28 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: news-server.san.rr.com | last post by:
How can I manually send a scroll command to a webbrowser control when the scroll bars are invisible? I tried the sendcommand but that did not work. Thanks for the help.
0
by: thomasp | last post by:
I am using VB.NET 2005 Beta. I have placed a small webbrowser control on a vb.net form that displays some useful information for the user. My question is how can I use code to get the browser to...
1
by: thomasp | last post by:
Using VB2005 Beta 2. I have a form that uses a small webbrowser control to display information to the user. I need to have the webbrowser control scroll to a certain position for each of the...
1
by: UJ | last post by:
How can I get rid of the scroll bars when I use a WebBrowser control? If the page/object I'm trying to display is to big - tough! I don't want the scroll bars. Thanks. Jeff.
4
by: iwdu15 | last post by:
hi, i have a web browser control on my win form, and every so often i add text to it. when the text goes beyond the last line, the control doesnt auto scroll to show it and there is no property...
1
by: dr | last post by:
how to scroll a webbrowser control down a page, e.g. the same as if a user hit page-down?
0
by: melon | last post by:
Hello, I am trying to incorporate the WebBrowser control in my application. The WebBrowser will only display one page and that page contains frames. However, it does not have a horizontal...
4
by: Rugen | last post by:
I have a webbrowser in my form and I want it to automatically scroll down to the center when the page is loaded... ( or 100pixels for example ) So how can I do this ? Can someone help me ?
3
by: TedTrippin | last post by:
Hi, Background - I've create a windows application in VS and added a WebBrowser component and all works well. I'm now trying to do this programmatically. My application now listens on a socket...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.