Function Reference


_GUICtrlEdit_GetFirstVisibleLine

Retrieves the 0-based index of the uppermost visible line in a multiline edit control

#include <GuiEdit.au3>
_GUICtrlEdit_GetFirstVisibleLine ( $hWnd )

Parameters

$hWnd Control ID/Handle to the control

Return Value

Returns a 0-based index of the uppermost visible line in a multiline edit control.

Remarks

The number of lines and the length of the lines in an edit control depend on the width of the control and the current Wordwrap setting.

Example

#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Local $idEdit

    ; Create GUI
    GUICreate("Edit Get First Visible Line", 400, 300)
    $idEdit = GUICtrlCreateEdit("", 2, 2, 394, 268)
    GUISetState(@SW_SHOW)

    For $x = 0 To 20
        _GUICtrlEdit_AppendText($idEdit, StringFormat("[%02d] Append to the end?", $x) & @CRLF)
    Next

    MsgBox($MB_SYSTEMMODAL, "Information", "First Visible Line: " & _GUICtrlEdit_GetFirstVisibleLine($idEdit))

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example