设置边框的像素大小
#Include <GuiMonthCal.au3>
_GUICtrlMonthCal_SetCalendarBorder($hWnd[, $iBorderSize = 4[, $fSetBorder = True]])
$hWnd | 控件句柄 |
$iBorderSize | [可选参数] 边框的像素大小 |
$fSetBorder | [可选参数] 下列值之一: True - 设置为 $iBorderSize 指定的像素数 alse - 重置为默认值指定的主题, 或零,不存在使用的主题 |
#include <GUIConstantsEx.au3>
#include <GuiMonthCal.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
$Debug_MC = False ; Check ClassName being passed to MonthCal functions, set to True and use a handle to another control to see it work
Global $iMemo
_Main()
Func _Main()
Local $hMonthCal
; 创建 GUI
GUICreate("Month Calendar", 400, 300)
$hMonthCal = GUICtrlCreateMonthCal("", 4, 4, -1, -1, $WS_BORDER, 0x00000000)
; 创建 memo 控件
$iMemo = GUICtrlCreateEdit("", 4, 168, 392, 128, 0)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; Get/Set calendar border
MemoWrite("Border in pixels: " & _GUICtrlMonthCal_GetCalendarBorder($hMonthCal))
Sleep(3000)
GUISetState(@SW_LOCK)
_GUICtrlMonthCal_SetCalendarBorder($hMonthCal, 2)
MemoWrite("Border in pixels: " & _GUICtrlMonthCal_GetCalendarBorder($hMonthCal))
GUISetState(@SW_UNLOCK)
Sleep(3000)
GUISetState(@SW_LOCK)
_GUICtrlMonthCal_SetCalendarBorder($hMonthCal, 0, False)
MemoWrite("Border in pixels: " & _GUICtrlMonthCal_GetCalendarBorder($hMonthCal))
GUISetState(@SW_UNLOCK)
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
; 写入消息到 memo
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite