函数参考


_GUICtrlSlider_SetThumbLength

设置滑块(指针)长度.
原文:Sets the length of the slider

#Include <GuiSlider.au3>
_GUICtrlSlider_SetThumbLength($hWnd, $iLength)

参数

$hWnd 控件句柄
$iLength 滑块(指针)长度像素值

返回值

None.

注意/说明

 如果控件没有 $TBS_FIXEDLENGTH 样式,本函数被忽略

相关

_GUICtrlSlider_GetThumbLength

示例/演示


#include <GUIConstantsEx.au3>
#include <GuiSlider.au3>

$Debug_S = False ; 检查传递给函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作

_Main()

Func _Main()
    Local $hSlider

    ; 创建 GUI
    GUICreate("Slider Set Thumb Length", 400, 296)
    $hSlider = GUICtrlCreateSlider(2, 2, 396, 25, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_FIXEDLENGTH))
    GUISetState()

    ; Get Thumb Length
    MsgBox(4160, "信息", "Thumb Length: " & _GUICtrlSlider_GetThumbLength($hSlider))

    ; Set Thumb Length
    _GUICtrlSlider_SetThumbLength($hSlider, 10)

    ; Get Thumb Length
    MsgBox(4160, "信息", "Thumb Length: " & _GUICtrlSlider_GetThumbLength($hSlider))

    ; 循环直到用户退出
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main