本帖最后由 lynfr8 于 2009-7-26 23:51 编辑
winmove移动指定的窗口或调整窗口的大小:是伸缩的关键
通过SetOnEvent点击链接就打开ACN网页 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
$Form = GUICreate("超链接+窗体伸缩 演示", 305, 108, 214, 153)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSE")
$Label = GUICtrlCreateLabel("链接", 34, 16, 36, 30)
GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
GUICtrlSetOnEvent(-1, "Click")
$Button = GUICtrlCreateButton("窗体伸缩-->", 16, 48, 80, 25)
GUICtrlSetOnEvent(-1, "Button")
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func CLOSE()
Exit
EndFunc
Func Click()
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe www.autoitx.com")
EndFunc
Func Button()
If GUICtrlRead($Button) = "窗体伸缩-->" Then
WinMove($Form, "", Default, Default, 500, Default)
GUICtrlSetData($Button, "窗体伸缩<--")
ElseIf GUICtrlRead($Button) = "窗体伸缩<--" Then
WinMove($Form, "", Default, Default, 305, Default)
GUICtrlSetData($Button, "窗体伸缩-->")
EndIf
EndFunc
|