AIT_SetScrollPos
- Organization of this page
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.
Value |
Description |
---|---|
EDIT_CTRL |
The control type is an edit control. |
LISTBOX_CTRL |
The control type is a list box. |
LIST_CTRL |
The control type is a list control. |
TREE_CTRL |
The control type is a tree control. |
nScrollType (input)
Specify a scroll bar type, which must be one of the following values.
Value |
Description |
---|---|
VSCROLL |
Vertical scroll bar |
HSCROLL |
Horizontal 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.
Value |
Description |
---|---|
SB_BOTTOM |
Moves the scroll bar to the bottom right. |
SB_LINEDOWN |
Moves the scroll bar to the next line. |
SB_LINEUP |
Moves the scroll bar to the above line. |
SB_PAGEDOWN |
Moves the scroll bar to the next page. |
SB_PAGEUP |
Moves the scroll bar to the previous page. |
SB_THUMBPOSITION |
The user has dragged the scroll box (thumb), and released the mouse button. |
SB_THUMBTRACK |
The user is dragging the scroll box. |
SB_TOP |
Moves the scroll bar to the top left. |
If nScrollType is HSCROLL, you have to set one of the following values.
Value |
Description |
---|---|
SB_LEFT |
Moves the scroll bar to the top left. |
SB_RIGHT |
Moves the scroll bar to the bottom right. |
SB_LINELEFT |
Moves the scroll bar to the left by one unit. |
SB_LINERIGHT |
Moves the scroll bar to the right by one unit. |
SB_PAGELEFT |
Moves the scroll bar to the left by the window width. |
SB_PAGERIGHT |
Moves the scroll bar to the right by the window width. |
SB_THUMBPOSITION |
The user has dragged the scroll box (thumb), and released the mouse button. |
SB_THUMBTRACK |
The 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 number |
Error code |
---|---|
8 |
ERROR_NOT_ENOUGH_MEMORY |
14 |
ERROR_OUTOFMEMORY |
87 |
ERROR_INVALID_PARAMETER |
112 |
ERROR_DISK_FULL |
1400 |
ERROR_INVALID_WINDOW_HANDLE |
1460 |
ERROR_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.