C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How Do I Scroll Programmatically in the WebBrowser Control
WhatsApp
Mike Gold
17y
21.6
k
0
0
25
Blog
void
MyScrollExample
::
Scroll
(
System
::
Windows
::
Forms
::
Keys
key
)
{
IHTMLElement
^
body
= ((
mshtml
::
IHTMLDocument2
^)
webBrowser1
->
Document
->
DomDocument
)->
body
;
IHTMLElement2
^
bodyInterface
= (
mshtml
::
IHTMLElement2
^)
body
;
switch
(
key
)
{
case
Keys
::
Home
:
bodyInterface
->
scrollTop
= 0;
break
;
case
Keys
::
End
:
bodyInterface
->
scrollTop
= 20000000;
break
;
default
:
break
;
}
}
People also reading
Membership not found