afan 老大 更為簡潔的例子
GUICreate('BtnSetBkColor', 250, 500)
Local $ii, $Max = 16, $Button[$Max + 1], $iY = 8, $iLast = 0, $aInfo
For $ii = 1 To $Max ;???不定
$Button[$ii] = GUICtrlCreateButton('Button' & $ii, 29, $iY, 195, 25)
GUICtrlSetBkColor(-1, 0x99B4D1)
$iY += 30
Next
GUISetState(@SW_SHOW)
While 1
$aInfo = GUIGetCursorInfo()
If Not @error Then
If $aInfo[4] <> $iLast Then
If $iLast Then GUICtrlSetBkColor($iLast, 0x99B4D1)
GUICtrlSetBkColor($aInfo[4], 0xEE2C2C)
$iLast = $aInfo[4]
EndIf
EndIf
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
EndSwitch
WEnd
|