Function Reference

_GUICtrlEdit_Scroll

テキストを垂直にスクロールします。

#Include <GuiEdit.au3>
_GUICtrlEdit_Scroll($hWnd, $iDirection)

 

パラメータ

$hWnd コントロールのハンドル
$iDirection このパラメータは次の値のいずれかです:
$SB_LINEDOWN - 1行下にスクロール
$SB_LINEUP - 1行上にスクロール
$SB_PAGEDOWN - 1ページ下にスクロール
$SB_PAGEUP - 1ページ上にスクロール
$SB_SCROLLCARET - 表示上でキャレットをスクロール

 

返し値

成功: 返し値の上位ワードはTRUEです
    下位ワードはコマンドがスクロールした行数です
失敗: 0

 

注意

$SB_xxxxxはScrollBarConstants.au3のインクルードを必要とします。

 

関連

_GUICtrlEdit_LineScroll

 


#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiEdit.au3>
#include <GuiStatusBar.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ScrollBarConstants.au3>

Opt('MustDeclareVars', 1)

$Debug_Ed = False ; Edit関数に渡されるClassNameを調べる。動作を確認するにはTrueを設定し、他のコントロールのハンドルを使用

_Main()

Func _Main()
    Local $StatusBar, $hEdit, $hGUI
    Local $Wow64 = ""
    If @AutoItX64 Then $Wow64 = "\Wow6432Node"
    Local $sFile = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $Wow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\include\changelog.txt"
    Local $aPartRightSide[3] = [200, 378, -1], $iLen

    ; GUI作成
    $hGUI = GUICreate("Edit Scroll", 400, 300)
    $hEdit = GUICtrlCreateEdit("", 2, 2, 394, 268, BitOR($ES_WANTRETURN, $WS_VSCROLL))
    $StatusBar = _GUICtrlStatusBar_Create($hGUI, $aPartRightSide)
    _GUICtrlStatusBar_SetIcon($StatusBar, 2, 97, "shell32.dll")
    GUISetState()

    ; 余白を設定
    _GUICtrlEdit_SetMargins($hEdit, BitOR($EC_LEFTMARGIN, $EC_RIGHTMARGIN), 10, 10)

    ; テキストを設定
    _GUICtrlEdit_SetText($hEdit, FileRead($sFile))

    MsgBox(4160, "Information", "Scroll Line Down")
    _GUICtrlEdit_Scroll($hEdit, $SB_LINEDOWN)

    MsgBox(4160, "Information", "Scroll Line Up")
    _GUICtrlEdit_Scroll($hEdit, $SB_LINEUP)

    MsgBox(4160, "Information", "Scroll Page Down")
    _GUICtrlEdit_Scroll($hEdit, $SB_PAGEDOWN)

    MsgBox(4160, "Information", "Scroll Page Up")
    _GUICtrlEdit_Scroll($hEdit, $SB_PAGEUP)

    $iLen = _GUICtrlEdit_GetTextLen($hEdit)
    _GUICtrlEdit_SetSel($hEdit, $iLen, $iLen)

    MsgBox(4160, "Information", "Scroll Caret")
    _GUICtrlEdit_Scroll($hEdit, $SB_SCROLLCARET)

    ; ユーザーが終了するまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main