AIT_SetScrollPos

Description

Moves the scroll bar.

Format

bool AIT_SetScrollPos (
 integer nCtrlID,         // Control ID
 integer nPosition        // Position
 [,float fTimeOut]        // Time-out
);
bool AIT_SetScrollPos (
 string strCaption,       // Control's caption
 integer nCtrlType,       // Control type
 integer nScrollType,     // Scroll type
 integer nPosition,       // Set position
 integer nScrollMovement  // Movement type
 [,float fTimeOut]        // Time-out
);
bool AIT_SetScrollPos (
 integer nCtrlID,         // Control ID
 integer nCtrlType,       // Control type
 integer nScrollType,     // Scroll type
 integer nPosition,       // Set position
 integer nScrollMovement  // Movement type
 [,float fTimeOut]        // Time-out
);

Parameters

nCtrlID (input)

Specify a control ID.

nPosition (input)

Specify a position to be set.

strCaption (input)

Specify the caption of a control.

nCtrlType (input)

Specify a control type for the scroll bar, which must be one of the following values.

ValueDescription
EDIT_CTRLThe control type is an edit control.
LISTBOX_CTRLThe control type is a list box.
LIST_CTRLThe control type is a list control.
TREE_CTRLThe control type is a tree control.

nScrollType (input)

Specify a scroll bar type, which must be one of the following values.

ValueDescription
VSCROLLVertical scroll bar
HSCROLLHorizontal scroll bar

nScrollMovement (input)

Specify the type of scroll bar control movement. If nScrollType is VSCROLL, you have to set one of the following values.

ValueDescription
SB_BOTTOMMoves the scroll bar to the bottom right.
SB_LINEDOWNMoves the scroll bar to the next line.
SB_LINEUPMoves the scroll bar to the above line.
SB_PAGEDOWNMoves the scroll bar to the next page.
SB_PAGEUPMoves the scroll bar to the previous page.
SB_THUMBPOSITIONThe user has dragged the scroll box (thumb), and released the mouse button.
SB_THUMBTRACKThe user is dragging the scroll box.
SB_TOPMoves the scroll bar to the top left.

If nScrollType is HSCROLL, you have to set one of the following values.

ValueDescription
SB_LEFTMoves the scroll bar to the top left.
SB_RIGHTMoves the scroll bar to the bottom right.
SB_LINELEFTMoves the scroll bar to the left by one unit.
SB_LINERIGHTMoves the scroll bar to the right by one unit.
SB_PAGELEFTMoves the scroll bar to the left by the window width.
SB_PAGERIGHTMoves the scroll bar to the right by the window width.
SB_THUMBPOSITIONThe user has dragged the scroll box (thumb), and released the mouse button.
SB_THUMBTRACKThe user is dragging the scroll box.

nTimeOut (input, optional)

Specify the maximum time this function can use to find the control, in units of seconds. The default is the value set in the AIT_SetDefaultWaitTimeout function.

Return values

The return value is true if the function was executed normally, and false if not. If the function has returned false, you can use AIT_GetLastError to acquire an extended error code. The following gives the error codes that AIT_GetLastError might return:

Extended error numberError code
8ERROR_NOT_ENOUGH_MEMORY
14ERROR_OUTOFMEMORY
87ERROR_INVALID_PARAMETER
112ERROR_DISK_FULL
1400ERROR_INVALID_WINDOW_HANDLE
1460ERROR_TIMEOUT

Note

You can identify the control by using a complete caption or an associated label name or specifying the first part of such a caption or label name. When specifying the first part, prefix a swung dash (~) to the character string that you specify.