[Hilfe] Radio

05/06/2009 13:53 Syc0n#1
Hey,

ich wollte mal fragen, ob man nen Radio Button "Transparent" machen kann, sodass man zwar den Text sieht, aber diesen weißen Hintergrund nicht.

PHP Code:
$Form1 GUICreate("Form666"499320210215)
$Button1 GUICtrlCreateButton("Start",407213749)
$Radio1 GUICtrlCreateRadio("Radio 1"4016010517)
$Pic1 GUICtrlCreatePic("blub.jpg"00497297BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) 
Habs schon mit WS_Transparten und so versucht aber ich kriegs net hin... wär nett, wenn ihr mir helfen könntet.

edit: ok ich machs einfach mit Transparten Label...
edit2: geht auch nich..
PHP Code:
$Label2 GUICtrlCreateLabel("Rabarbar"5618410220)
GUICtrlSetFont(-1104000"MS Sans Serif")
GUICtrlSetBkColor(-1$GUI_BKCOLOR_TRANSPARENT
Wo liget der Fehler?
05/06/2009 15:40 kknb#2
solln deine radio buttons auf dem bild sein?
05/06/2009 16:05 Syc0n#3
Also die Buttons sollen auf dem Bild seien und auch den Hintergrund vom Bild haben. Hab auch schon [Only registered and activated users can see links. Click Here To Register...] geguckt, aber das hat mir leider auch nicht weitergeholfen...
05/06/2009 16:11 kknb#4
jo kenne ich, gibt dafür kaum ne brauchbare lösung.

du kannst das evtl so lösen:
Code:
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

GUICreate("My GUI radio", 202, 80)
GUICtrlCreatePic('Bild.jpg', 0, 0, 202, 80, 0)

$radio1 = GUICtrlCreateRadio("Radio1", 10, 10, 75, 22, $BS_PUSHLIKE)
$radio2 = GUICtrlCreateRadio("Radio2", 10, 40, 75, 22, $BS_PUSHLIKE)
GUISetState()

While 1
sleep(100)
WEnd
oder so evtl.

Code:
#include <GUIConstants.au3>
#Include <WinAPI.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>


; Dies ist der erste Streich ...
GUIRegisterMsg ($WM_CTLCOLORSTATIC, 'WM_CTLCOLORSTATIC')

$hWndMain      = GUICreate ("My CheckBox Button with Transparency", 300, 200, _
                                                                   -1, -1, _
                                                                   $WS_OVERLAPPEDWINDOW)

GUISetBkColor (0x00ff00)

$pic           = GUICtrlCreatePic (@SystemDir & '\oobe\images\wpaback.jpg', 0, 0, 300, 200)
GUICtrlSetState (-1, $GUI_DISABLE)

$btnCheckBox   = GUICtrlCreateCheckbox ('Checkbox', 100, 90, 100, 20)
; ... und der zweite folgt sogleich. ;)
DllCall ('UxTheme.dll', 'int', 'SetWindowTheme', 'hwnd', GUICtrlGetHandle (-1), 'wstr', ' ', 'wstr', ' ')

$btnPushButton = GUICtrlCreateButton ('PushButton', 110, 150, 80, 20)

GUISetState ()


While True

    Switch GUIGetMsg ()
        Case -3
            Exit
    EndSwitch

WEnd


;========================================================================================
;        WM_CTLCOLORSTATIC ($hDC, $hCtrl)
;========================================================================================
Func WM_CTLCOLORSTATIC ($hWnd, $Msg, $wParam, $lParam)

    Local $hDC = $wParam

    SetBkMode ($hDC, $TRANSPARENT)
    Return _WinAPI_GetStockObject (5) ; 5 = NULL_BRUSH/HOLLOW_BRUSH

EndFunc

;========================================================================================
;        Func SetBkMode ()
;========================================================================================
Func SetBkMode ($hDC, $flag = 0)

    If  ($flag < 0 Or $flag > 1) Then Return SetError (1)

    DllCall ('gdi32.dll', 'int', 'SetBkMode', _
                                'hwnd', $hDC, _    ; handle to Decive Context
                                'int', $flag)      ; $flag: 1 = TRANSPARENT, 0 = OPAQUE

EndFunc
hab ich irgendwo ausm autoit forum.
05/06/2009 16:49 Syc0n#5
Schade, funktioniert leider beides bei mir nicht...
05/06/2009 17:00 kknb#6
naja funktionieren tuts sicher, sind nur leider dann keine richtigen radioboxen mehr. ist halt nur ne alternativlösung das man keine hässlichen ränder hat.
05/06/2009 17:03 Syc0n#7
Weiß denn einer wie man ganz normale Labels Transparent auf en pic setzt?
edit: Habs
PHP Code:
GUICtrlCreatePic($picture00320240)
GUICtrlSetState(Default, $GUI_DISABLE
Label
PHP Code:
GUICtrlSetBkColor(Default, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(Default, 0xFFFFFF
Wichtig dabei war erst das Pic zu machen und dann das Label