Application

Scrolling

Methods for scrolling UI Automation elements within a desktop application, both vertically and horizontally.

Methods for scrolling UI Automation elements within a desktop application, both vertically and horizontally.

ScrollVerticalLarge scrolls down in large increments (equivalent to pressing Page Down). ScrollVerticalSmall scrolls in small increments (equivalent to pressing the Down arrow key). ScrollVerticalPercent sets the vertical scroll position as a percentage of the total scrollable range. The Horizontal variants do the same on the X axis. All scroll methods take an integer - for Large and Small variants it is the number of scroll iterations; for Percent it is the target position (0-100).

Examples

GPAL Fluent: High-level fluent C# API

//Scroll methods act on the element matched by WithSelector. The element must support the Scroll UI Automation pattern - most scrollable controls (ListBox, ListView, DataGridView, etc.) do.

// Scroll a list view to the bottom in large increments GPAL.Application .Open("C:\MyApp\app.exe") .WithSelector(GPAL.Selector.WithAutomationID("lstResults")) .ScrollVerticalLarge(10); // Jump to 50% of the way down GPAL.Application .WithSelector(GPAL.Selector.WithAutomationID("lstResults")) .ScrollVerticalPercent(50);