本帖最后由 xyhqqaa 于 2012-6-7 08:25 编辑
最初的想法是点击2的时候,2之前所点击过的其他控件全部失去焦点。但是新手纠结下。。。不知道咋排除。。。现在点击的话。其他所选择焦点还是存在,意思等于我想单选。。。现在确是全选。。如图
简单代码如下:#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
Dim $Pic[99],$Graphic[99]
$Form1 = GUICreate("Form1", 188, 369, 509, 271)
$Graphic[1] = GUICtrlCreateGraphic(0, 0, 185, 49)
GUICtrlSetColor(-1, 0x008000)
$Pic[1] = GUICtrlCreatePic("E:\360云盘\皮肤\5.jpg", 2, 2, 180, 44)
$Graphic[2] = GUICtrlCreateGraphic(0, 56, 185, 49)
GUICtrlSetColor(-1, 0x008000)
$Pic[2]= GUICtrlCreatePic("E:\360云盘\皮肤\2.jpg", 2, 58, 180, 44)
$Graphic[3] = GUICtrlCreateGraphic(0, 112, 185, 49)
GUICtrlSetColor(-1, 0x008000)
$Pic[3] = GUICtrlCreatePic("E:\360云盘\皮肤\3.jpg", 2, 115, 180, 44)
$Graphic[4] = GUICtrlCreateGraphic(0, 168, 185, 49)
GUICtrlSetColor(-1, 0x008000)
$Pic[4] = GUICtrlCreatePic("E:\360云盘\皮肤\4.jpg", 2, 170, 180, 44)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$guiinfo = GUIGetCursorInfo($Form1)
$nMsg = GUIGetMsg()
Select
Case $nMsg = -3
Exit
Case $guiinfo[2] = 1;主要这边啦
For $i=1 To 9
If $guiinfo[4] = $Pic[$i] Then
GUICtrlSetColor($Graphic[$i], 0xFF0000)
EndIf
next
EndSelect
WEnd
|