Veröffentlicht 27. April 200520 j Hallo miteinander, hab nach langer Zeit mal wieder ein Problem.. Wie mache ich die Form transparent? :confused: Über form1.BackColor = XXX, kann ich der Form sagen, daß sie die Farbe des Desktops übernehmen soll. Wenn aber ein Wallpaper als Desktophintergrund genutzt wird, übernimmt die Form totzdem die Farbe des Desktops. -> also nicht wirklich transparent... Kann mir jemand helfen mit Tips, Code oder wenigstens n Schubser in die richtige Richtung?
27. April 200520 j öhm visible= false? oder willst du das ganze halbtransparent machen? Auf der Form ist noch ein Label, daß die aktuelle CPU-Geschwindikeit anzeigt. Der Hintergrund des Labels ist Transparent. Die Form wird gestartet, im Label zeigts die aktuelle CPU-Geschwindikeit und wird nach 10s automatisch beendet. Die Form wird mit BorderStyle 0 gestartet, hat also nicht mal ne Leiste mit den 3 Standard-Buttons (min, max, X). Will nur das alles Transparent ist und nur die CPU-Geschwindikeit zu sehen ist.
27. April 200520 j Offensichtlich hast du noch keine Google-Suche zu diesem Thema versucht, sonst wärst du beim ersten Link zu http://spotlight.de/zforen/amvb/m/amvb-1068394939-82.html gekommen, der sagt: Private Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" (ByVal hWnd As Long, _ ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" _ Alias "SetWindowLongA" (ByVal hWnd As Long, _ ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function SetLayeredWindowAttributes _ Lib "user32" (ByVal hWnd As Long, _ ByVal crKey As Long, ByVal bAlpha As Byte, _ ByVal dwFlags As Long) As Long Const LWA_COLORKEY = &H1 Const LWA_ALPHA = &H2 Const GWL_EXSTYLE = (-20) Const WS_EX_LAYERED = &H80000 Const WS_EX_NOINHERITLAYOUT = &H100000 Private Sub Form_Load() Dim hRslt As Long hRslt = GetWindowLong(Me.hWnd, GWL_EXSTYLE) hRslt = hRslt Or WS_EX_NOINHERITLAYOUT Or WS_EX_LAYERED SetWindowLong Me.hWnd, GWL_EXSTYLE, hRslt Me.BackColor = RGB(0, 255, 0) SetLayeredWindowAttributes Me.hWnd, Me.BackColor, 0, LWA_COLORKEY End Sub Und du gibst ihm halt als alpha-Wert ... k.A. z.B. 50
27. April 200520 j Offensichtlich hast du noch keine Google-Suche zu diesem Thema versucht, sonst wärst du beim ersten Link zu http://spotlight.de/zforen/amvb/m/amvb-1068394939-82.html gekommen, der sagt: Private Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" (ByVal hWnd As Long, _ ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" _ Alias "SetWindowLongA" (ByVal hWnd As Long, _ ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function SetLayeredWindowAttributes _ Lib "user32" (ByVal hWnd As Long, _ ByVal crKey As Long, ByVal bAlpha As Byte, _ ByVal dwFlags As Long) As Long Const LWA_COLORKEY = &H1 Const LWA_ALPHA = &H2 Const GWL_EXSTYLE = (-20) Const WS_EX_LAYERED = &H80000 Const WS_EX_NOINHERITLAYOUT = &H100000 Private Sub Form_Load() Dim hRslt As Long hRslt = GetWindowLong(Me.hWnd, GWL_EXSTYLE) hRslt = hRslt Or WS_EX_NOINHERITLAYOUT Or WS_EX_LAYERED SetWindowLong Me.hWnd, GWL_EXSTYLE, hRslt Me.BackColor = RGB(0, 255, 0) SetLayeredWindowAttributes Me.hWnd, Me.BackColor, 0, LWA_COLORKEY End Sub Und du gibst ihm halt als alpha-Wert ... k.A. z.B. 50 Isch habe gegoogelt! , Habe auch was gefunden, aber leider nicht so ganz das richtige bzw. ich hatte Probleme dies zuverstehen und anzupassen. :cool: Ups.. was vergessen.. DANKE DIR!!!! :uli Genau das was ich gesucht habe!
Archiv
Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.