回复 1# duyan
$bj不能只设一个
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 400, 400)
Local $Button[5],$bj[5]
GUISetState()
For $p2 = 0 To 4
$Button[$p2] = GUICtrlCreatePic( $p2 & ".jpg", 164, 70 * $p2 + 20, 64, 64)
Next
$Over = -1
While 1
$ID = GUIGetCursorInfo()
For $p2 = 0 To 4
If $ID[4] = $Button[$p2] And $bj[$p2] = 0 Then
GUICtrlSetImage($Button[$p2], "8.jpg")
$bj[$p2] = 1
ElseIf $ID[4] <> $Button[$p2] And $bj[$p2] = 1 Then
GUICtrlSetImage($Button[$p2], $p2 & ".jpg")
$bj[$p2] = 0
EndIf
Next
$nMsg = GUIGetMsg(1)
Switch $nMsg[0]
Case -3
Exit
EndSwitch
WEnd
|