=============下面是代码==================
问题二代码:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Opt("TrayIconDebug",1)
#Region
$Form1 = GUICreate("Form1", 229, 107, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE,"_GUIOnEvent")
$Progress1 = GUICtrlCreateProgress(8, 16, 214, 17, $PBS_SMOOTH)
$Progress2 = GUICtrlCreateProgress(8, 40, 214, 17, $PBS_SMOOTH)
$Button1 = GUICtrlCreateButton("暂停", 16, 72, 59, 25)
GUICtrlSetOnEvent(-1,"_GUIOnEvent")
$Button2 = GUICtrlCreateButton("退出", 152, 72, 59, 25)
GUICtrlSetOnEvent(-1,"_GUIOnEvent")
GUISetState(@SW_SHOW)
#EndRegion
While 1
For $i=0 To 100
GUICtrlSetData($Progress1,$i)
GUICtrlSetData($Progress2,100-$i)
Sleep(40)
Next
Sleep(500)
WEnd
Func _GUIOnEvent()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
MsgBox(0,'',"test")
Case $Button2
EndSwitch
EndFunc
问题一代码:
#include <GUIConstantsEx.au3>
$Form1 = GUICreate("输入框点击例子", 341, 208)
$Input1 = GUICtrlCreateInput("点击我", 72, 40, 153, 33)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_PRIMARYDOWN
$Pos = GUIGetCursorInfo($Form1)
If $Pos[4] = $Input1 Then
If GUICtrlRead($Input1)="点击我" Then
GUICtrlSetData($Input1,"")
EndIf
Else
If GUICtrlRead($Input1)="" Then
GUICtrlSetData($Input1,"点击我")
EndIf
EndIf
EndSwitch
WEnd