检索显示完整月历所需的最低高度
#Include <GuiMonthCal.au3>
_GUICtrlMonthCal_GetMinReqHeight($hWnd)
$hWnd | 控件句柄 |
成功: | 返回最低像素高度 |
#include <GUIConstantsEx.au3>
#include <GuiMonthCal.au3>
#include <WindowsConstants.au3>
$Debug_MC = False ; 检查传递给 MonthCal 函数的类名, 设置为 True 并使用指向另一控件的句柄来检查它是否工作
Global $iMemo
_Main()
Func _Main()
Local $hMonthCal
; 创建 GUI
GUICreate("Month Calendar Get Min Req Height", 400, 300)
$hMonthCal = GUICtrlCreateMonthCal("", 4, 4, -1, -1, BitOR($WS_BORDER, $MCS_MULTISELECT), 0x00000000)
; 创建 memo 控件
$iMemo = GUICtrlCreateEdit("", 4, 168, 392, 128, 0)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; 获取需要的最小高度/宽度
MemoWrite("Minimum required height: " & _GUICtrlMonthCal_GetMinReqHeight($hMonthCal))
MemoWrite("Minimum required width : " & _GUICtrlMonthCal_GetMinReqWidth($hMonthCal))
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
; 写入消息到 memo
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite