#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
Example()
Func Example()
Local $msg, $B = 0
$GUI = GUICreate("函数演示") ; 创建居中显示的对话框窗口
$Button = GUICtrlCreateButton("图像按钮", 100, 100, 80, 80, $BS_ICON)
GUICtrlSetImage(-1, "shell32.dll", 22)
GUISetState()
; 运行 GUI,直到对话框窗口关闭
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
$Pos = GUIGetCursorInfo($GUI)
If $Pos[4] = $Button And $B = 0 Then
GUICtrlSetImage($Button, "shell32.dll", 23)
$B = 1
ElseIf $Pos[4] <> $Button And $B = 1 Then
GUICtrlSetImage($Button, "shell32.dll", 22)
$B = 0
EndIf
WEnd
EndFunc ;==>Example
|