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

Home Posts Topics Members FAQ

webbrowser scroll down

2 New Member
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 ?
Oct 2 '07 #1
4 5787
gllns
1 New Member
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 ?
Expand|Select|Wrap|Line Numbers
  1. HtmlDocument document = myWebBrowser.Document;
  2. HtmlElement body = document.Body;
  3. body.ScrollTop = body.ScrollRectangle.Height;
  4.  
Do not forget document == null and body == document tests.
Oct 2 '07 #2
Plater
7,872 Recognized Expert Expert
Expand|Select|Wrap|Line Numbers
  1. HtmlDocument document = myWebBrowser.Document;
  2. HtmlElement body = document.Body;
  3. body.ScrollTop = body.ScrollRectangle.Height;
  4.  
Do not forget document == null and body == document tests.
Does that really work? I've been looking for something like this also.
Oct 2 '07 #3
Rugen
2 New Member
Can you type it like you would in visual studio 2005 plz ?
Oct 3 '07 #4
Plater
7,872 Recognized Expert Expert
Can you type it like you would in visual studio 2005 plz ?
Uhhh, he did type it like it would be in vs 2005?
Expand|Select|Wrap|Line Numbers
  1. //C#
  2. HtmlDocument document = myWebBrowser.Document;
  3. HtmlElement body = document.Body;
  4. body.ScrollTop = body.ScrollRectangle.Height;
  5.  
Oct 3 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
7986
by: Noozer | last post by:
I am able to place values on forms that load into my webbrowser control, but I'd like to be able to scan the page for data. I know to use the HTMLDocument object. Basically I'm hoping to find an example of a DocumentComplete routine that will: - display a list of all elements (tags?) on the page - number of forms on the page - ID, name, type and value for each field on the form
2
440
by: Danny | last post by:
The webbrowser tool is nice. BUT, does anybody know a way to resize it in such a format that shows the user a smaller version of the webpages? Right now it just shows them a portion or a corner and you have to scroll to see it all. I need to scale it down. Thanks
2
3554
by: Freddie | last post by:
I am using the AxWebBrowser component in my C# .NET application and am navigating to an outside .HTML file periodically. Whenever I refresh the WebBrowser with the updated HTML file by using Navigate method, it displays it from the top. How do I automatically scroll the view down to the last line of the document? Thanks!
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.
11
2849
by: Anil Gupte | last post by:
....and how do I insert one into my form? I used in VB 6.0 last, but cannot figure out where it is in .Net Thanx, -- Anil Gupte www.keeninc.net www.icinema.com
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?
3
21943
by: Zytan | last post by:
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
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...
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...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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.