检索当前水平边框宽度
#Include <GuiStatusBar.au3>
_GUICtrlStatusBar_GetBordersHorz($hWnd)
$hWnd | 控件句柄 |
成功: | 水平边框宽度 |
失败: | 设置@error |
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
$Debug_SB = False ; 检查传递给函数的类名, 设置为真并使用另一控件的句柄可以看出它是否有效
Global $iMemo
_Main()
Func _Main()
Local $hGUI, $hStatus
Local $aParts[3] = [75, 150, -1]
; 创建 GUI
$hGUI = GUICreate("StatusBar Get Borders Horizontal", 400, 300)
$hStatus = _GUICtrlStatusBar_Create($hGUI)
_GUICtrlStatusBar_SetParts($hStatus, $aParts)
; 创建 memo 控件
$iMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; 获取边框尺寸
MemoWrite("Horizontal border width .: " & _GUICtrlStatusBar_GetBordersHorz($hStatus))
MemoWrite("Vertical border width ...: " & _GUICtrlStatusBar_GetBordersVert($hStatus))
MemoWrite("Width between rectangles : " & _GUICtrlStatusBar_GetBordersRect($hStatus))
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
; 写入消息到 memo
Func MemoWrite($sMessage = "")
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite