Partager via


ScrollRectIntoView method

Scrolls a specific rectangular region into view on the display.

Syntax

HRESULT retVal = object.ScrollRectIntoView(pIElement, rect);

Parameters

  • pIElement [in]
    Type: IHTMLElement

    A pointer to an IHTMLElement interface that specifies the scrollable region.

  • rect [in]
    Type: RECT

    A RECT structure that specifies the area to bring into view within the scrollable region of pIElement.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The pIElement parameter resolves ambiguities if there is more than one scrolling element in a document. For example, if a document has a textArea element in the body element, set pIElement to the body element to scroll in relationship to the document window. If you set pIElement to the textArea element, the scrolling occurs in the scrollable region of the textArea.