Share via


ScrollPattern_SetScrollPercent Function

Scrolls a container to a specific position horizontally, vertically, or both.

Syntax

HRESULT ScrollPattern_SetScrollPercent(      
    HUIAPATTERNOBJECT hobj,
    double horizontalPercent,
    double verticalPercent
);

Parameters

  • hobj
    [in] The control pattern object.
  • horizontalPercent
    [in] The horizontal position to scroll to.
  • verticalPercent
    [in] The vertical position to scroll to.

Return Value

Returns S_OK if successful or an error value otherwise.

Remarks

The scroll area is normalized to range from 0.0 to 100.0. If the position is set to 0.0, the control scrolls to the beginning of the visible region, and if the position is set to 100.0, it scrolls to the end of the visible region. Pass -1.0 for the percent parameters if no scrolling occurs on that axis.

Function Information

Stock Implementation uiautomationcore.dll
Custom Implementation No
Header uiautomationcoreapi.h
Import library uiautomationcore.lib
Minimum operating systems Windows XP