ZennoLab Assemblies Documentation
ScrollIntoView Method
Example 
The performs scroll the tab to the current html element.
Syntax
public void ScrollIntoView()
Remarks
This method performs only the scrolling to the current html element. It may need when necessary change the view of the tab and for example perform click by coordinates inside the tab using the Tab class methods.
Example
The following code example demonstrates uses of the ScrollIntoView method.
// navigate to lessons.zennolab.com
instance.ActiveTab.Navigate("lessons.zennolab.com", "");
 
// wait downloading
instance.ActiveTab.WaitDownloading();
 
// try find the html element
HtmlElement he = instance.ActiveTab.MainDocument.FindElementByAttribute("textarea", "name", "text", "text", 0);
 
// if html element was found
if (!he.IsVoid)
{
    // scroll view of tab to the html element
    he.ScrollIntoView();
    
    // performs the click inside tab by coordinates
    instance.ActiveTab.MouseClick(he.DisplacementInTabWindow.X + 10, he.DisplacementInTabWindow.Y + 10, "left", "click");
    
    // send the text
    instance.SendText("It's just example. If you see this text then all work correctly. Don't forget to buy one more ZennoPoster.", 75);
}
// navigate to lessons.zennolab.com
$instance->ActiveTab->Navigate("lessons.zennolab.com", "");
 
// wait downloading
$instance->ActiveTab->WaitDownloading();
 
// try find the html element
$he = $instance->ActiveTab->MainDocument->FindElementByAttribute("textarea", "name", "text", "text", 0);
 
// if html element was found
if (!$he->IsVoid)
{
    // scroll view of tab to the html element
    $he->ScrollIntoView();
    
    // performs the click inside tab by coordinates
    $instance->ActiveTab->MouseClick($he->DisplacementInTabWindow->X + 10, $he->DisplacementInTabWindow->Y + 10, "left", "click");
    
    // send the text
    $instance->SendText("It's just example. If you see this text then all work correctly. Don't forget to buy one more ZennoPoster.", 75);
}
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

HtmlElement Class
HtmlElement Members
Tab Class
MouseClick Method
MouseMove Method
SendText Method

Send Feedback