How Do I Scroll Programmatically in the WebBrowser Control

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;

}

}

Ebook Download
View all
Learn
View all