Только так:
Код:
#include <GUIConstantsEx.au3>
GUICreate("Transparent Radio Button", 265, 210, -1, -1, -1, 0x00000218)
GUISetBkColor(0x0)
; Make a group.
$Group = GUICtrlCreateGroup("", 10, 10, 245, 170)
; Radio buttons.
$aRadio1 = _GUICtrlCreateRadio("Radio 1", 20, 30, 80, 15, $GUI_BKCOLOR_TRANSPARENT, 0x00FF00) ; Green
$aRadio2 = _GUICtrlCreateRadio("Radio 2", 20, 50, 80, 15, $GUI_BKCOLOR_TRANSPARENT, 0xFFFFFF) ; White
$aRadio3 = _GUICtrlCreateRadio("Radio 3", 20, 70, 80, 15, $GUI_BKCOLOR_TRANSPARENT, 0xFF0000) ; Red
$aRadio4 = _GUICtrlCreateRadio("Radio 4", 20, 90, 80, 15, $GUI_BKCOLOR_TRANSPARENT, 0x0000FF) ; Blue
$aRadio5 = _GUICtrlCreateRadio("Radio 5", 20, 110, 80, 15, $GUI_BKCOLOR_TRANSPARENT, 0xCCCCCC) ; Gray
$aRadio6 = _GUICtrlCreateRadio("Radio 6", 20, 130, 80, 15, $GUI_BKCOLOR_TRANSPARENT, 0xCC00FF) ; Purple
$aRadio7 = _GUICtrlCreateRadio("Radio 7", 20, 150, 80, 15, $GUI_BKCOLOR_TRANSPARENT, 0x00CCFF) ; Green-Blue
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $aRadio1[0] To $aRadio7[0], $aRadio1[1] To $aRadio7[1]
For $i = 1 To 7
$vRadio = Execute("$aRadio" & $i & "[0]")
GUICtrlSetState($vRadio, $GUI_UNCHECKED)
If $vRadio = $nMsg - 1 Or $vRadio = $nMsg Then
GUICtrlSetState($vRadio, $GUI_CHECKED)
EndIf
Next
EndSwitch
Wend
Func _GUICtrlCreateRadio($sText, $iLeft, $iTop, $iLength, $iHieght, $sBackColor = "" , $sTextColor = "")
Local $aRadioID[2]
$aRadioID[0] = GUICtrlCreateRadio("", $iLeft, $iTop, 12, 12)
$aRadioID[1] = GUICtrlCreateLabel($sText, $iLeft + 15, $iTop, $iLength - 15, $iHieght)
If $sTextColor <> "" And $aRadioID[1] Then
GUICtrlSetColor($aRadioID[1], $sTextColor)
EndIf
If $sBackColor <> "" And $aRadioID[1] Then
GUICtrlSetBkColor($aRadioID[1], $sBackColor)
EndIf
Return $aRadioID
EndFunc
|