473,804 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Docum ent.Body.Scroll Top = 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 21943
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**********@y ahoo.comwrote in message
news:11******** **************@ e65g2000hsc.goo glegroups.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.Docum ent.Body.Scroll Top = 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(WebBrows er webControl)
{
if (webControl.Doc ument != null)
webControl.Docu ment.Body.Scrol lTop = int.MaxValue;
}

But, it seems to only work when you do:
webControl.Docu ment.Write(s);
and not when you call this first, like MSDN asks you to:
webControl.Docu ment.OpenNew(tr ue);
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
4115
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
1339
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 scroll up and down when the user clicks on other objects on the form. I want it to scroll to a point in the document that is relevant to the control that is clicked. I had this working with a richtextbox, but needed to change to a browser. ...
1
1509
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 other controls on the form. I had this working with a richtextbox, but needed to change to a webbrowser control. Thanks for any help you can provide. Thanks, Thomas
1
2874
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
3660
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 governing this. i have to use a webbrowser control so how can i get this to occur? thanks -- -iwdu15
1
2922
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
1708
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 scroll bar on one of the frame for some reason. The same page works fine on IE 6 and 7.
4
5787
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
9445
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 and when it receives a request it creates a new Form and adds a new WebBrowser. The problem - All works well without the WebBrowser, the form is visible, but when I do "Controls.Add(webBrowser)" I see nothing, not even something in the windows...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.