Scrolls the text
#include <GuiEdit.au3>
_GUICtrlEdit_LineScroll ( $hWnd, $iHoriz, $iVert )
$hWnd | Control ID/Handle to the control |
$iHoriz | Specifies the number of characters to scroll horizontally. |
$iVert | Specifies the number of lines to scroll vertically. |
Success: | True. |
Failure: | False. |
The control does not scroll vertically past the last line of text in the edit control.
If the current line plus the number of lines specified by the $iVert parameter exceeds the total number of lines in the edit control, the value is adjusted so that the last line of the edit control is scrolled to the top of the edit-control window.
_GUICtrlEdit_LineScroll() scrolls the text vertically or horizontally.
_GUICtrlEdit_LineScroll() can be used to scroll horizontally past the last character of any line.
#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
Local $hStatusBar, $idEdit, $hGUI, $sText
; Create GUI
$hGUI = GUICreate("Edit Line Scroll", 400, 300)
$idEdit = GUICtrlCreateEdit("", 2, 2, 394, 268, BitOR($ES_WANTRETURN, $WS_VSCROLL))
$hStatusBar = _GUICtrlStatusBar_Create($hGUI)
GUISetState(@SW_SHOW)
; Set Text
For $i = 1 To 50
$sText &= $i & @CRLF
Next
_GUICtrlEdit_SetText($idEdit, $sText)
; Scroll
_GUICtrlStatusBar_SetText($hStatusBar, "Scrolled: " & _GUICtrlEdit_LineScroll($idEdit, 0, _GUICtrlEdit_GetLineCount($idEdit)))
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example