设置工具提示控件位置
#Include <GuiSlider.au3>
_GUICtrlSlider_SetTipSide($hWnd, $fLocation)
$hWnd | 控件句柄 |
$fLocation | 显示工具提示控件的位置.这个值可以是下列之一: $TBTS_TOP - 定位于水平滑块上方. $TBTS_LEFT - 定位到垂直滑块左边. $TBTS_BOTTOM - 定位到水平滑块下方. $TBTS_RIGHT - 定位到垂直滑块右边. |
成功: | 返回工具提示控件的以前位置 |
返回值等于 $fLocation 的可能值之一 |
#include <GUIConstantsEx.au3>
#include <GuiSlider.au3>
$Debug_S = False ; 检查传递给函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作
_Main()
Func _Main()
Local $rdoBottom, $rdoLeft, $rdoRight, $rdoTop, $hSlider, $hSlider2
; 创建 GUI
GUICreate("Slider Set Tip Side", 400, 296)
$hSlider = GUICtrlCreateSlider(2, 2, 375, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS))
$hSlider2 = GUICtrlCreateSlider(380, 2, 20, 292, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_VERT))
GUISetState()
GUICtrlCreateGroup("Tip Side Horiz", 2, 25, 120, 120)
$rdoBottom = GUICtrlCreateRadio("Bottom", 5, 40, 108, 20)
$rdoTop = GUICtrlCreateRadio("Top", 5, 115, 108, 20)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState($rdoTop, $GUI_CHECKED)
GUICtrlCreateGroup("Tip Side Vert", 130, 25, 120, 120)
$rdoLeft = GUICtrlCreateRadio("Left", 132, 65, 108, 20)
$rdoRight = GUICtrlCreateRadio("Right", 132, 90, 108, 20)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState($rdoLeft, $GUI_CHECKED)
; 循环直到用户退出
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $rdoBottom
_GUICtrlSlider_SetTipSide($hSlider, $TBTS_BOTTOM)
Case $rdoLeft
_GUICtrlSlider_SetTipSide($hSlider2, $TBTS_LEFT)
Case $rdoRight
_GUICtrlSlider_SetTipSide($hSlider2, $TBTS_RIGHT)
Case $rdoTop
_GUICtrlSlider_SetTipSide($hSlider, $TBTS_TOP)
EndSwitch
WEnd
GUIDelete()
EndFunc ;==>_Main