函数参考


_GUIScrollBars_SetScrollInfoPage

设置页面大小

#Include <GuiScrollBars.au3>
_GUIScrollBars_SetScrollInfoPage($hWnd, $fnBar, $nPage)

参数

$hWnd 窗口句柄
$fnBar 指定滚动控件的类型. 参数可以是以下值之一:
$SB_CTL - 设置滚动控件参数. $hWnd 必须是滚动控件的窗口句柄
$SB_HORZ - 设置窗口的标准水平滚动控件的参数.
$SB_VERT - 设置窗口标准垂直滚动控件的参数.
$nPage 页面大小

返回值

成功: 返回滚动条的当前位置
失败: 设置@error:

注意/说明

 以上常数需要 ScrollBarConstants.au3

相关

_GUIScrollBars_SetScrollInfo

示例/演示


#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>
#include <GuiScrollBars.au3>
#include <ScrollBarConstants.au3>

Global $iMemo

_Main()

Func _Main()
    Local $GUIMsg, $hGUI

    $hGUI = GUICreate("ScrollBar Example", 400, 400, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))
    $iMemo = GUICtrlCreateEdit("", 2, 2, 380, 380, BitOR($WS_HSCROLL, $WS_VSCROLL))
    GUICtrlSetResizing($iMemo, $GUI_DOCKALL)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
    GUISetBkColor(0x88AABB)

    GUISetState()

    _GUIScrollBars_Init($hGUI)

    _GUIScrollBars_SetScrollInfoMin($hGUI, $SB_HORZ, 10)
    _GUIScrollBars_SetScrollInfoMax($hGUI, $SB_HORZ, 80)
    _GUIScrollBars_SetScrollInfoPage($hGUI, $SB_HORZ, 60)

    MemoWrite("Horizontal" & @CRLF & "--------------------------------------")
    MemoWrite("nPage....: " & _GUIScrollBars_GetScrollInfoPage($hGUI, $SB_HORZ))
    MemoWrite("nPos.....: " & _GUIScrollBars_GetScrollInfoPos($hGUI, $SB_HORZ))
    MemoWrite("nMin.....: " & _GUIScrollBars_GetScrollInfoMin($hGUI, $SB_HORZ))
    MemoWrite("nMax.....: " & _GUIScrollBars_GetScrollInfoMax($hGUI, $SB_HORZ))
    MemoWrite("nTrackPos: " & _GUIScrollBars_GetScrollInfoTrackPos($hGUI, $SB_HORZ))

    MemoWrite(@CRLF & "Vertical" & @CRLF & "--------------------------------------")
    MemoWrite("nPage....: " & _GUIScrollBars_GetScrollInfoPage($hGUI, $SB_VERT))
    MemoWrite("nPos.....: " & _GUIScrollBars_GetScrollInfoPos($hGUI, $SB_VERT))
    MemoWrite("nMin.....: " & _GUIScrollBars_GetScrollInfoMin($hGUI, $SB_VERT))
    MemoWrite("nMax.....: " & _GUIScrollBars_GetScrollInfoMax($hGUI, $SB_VERT))
    MemoWrite("nTrackPos: " & _GUIScrollBars_GetScrollInfoTrackPos($hGUI, $SB_VERT))

    While 1
        $GUIMsg = GUIGetMsg()

        Switch $GUIMsg
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd

    Exit
EndFunc   ;==>_Main

; 写入一行到 memo 控件
Func MemoWrite($sMessage)
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite