"Henrik" <dsl122981@vip.cybercity.dk> skrev i en meddelelse
news:bsrivd$108n$1@news.cybercity.dk...
> hej
> er det muligt at lave en form transparent (backcolor)
> på forhånd tak
Herunder en kode, som jeg har fundet et eller andet sted - det virker, men
jeg synes ikke, at det er voldsomt overbevisende...
------------
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_TRANSPARENT = &H20
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const SWP_SHOWME = SWP_FRAMECHANGED Or _
SWP_NOMOVE Or SWP_NOSIZE
Private Const HWND_NOTOPMOST = -2
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 SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter _
As Long, ByVal x As Long, ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long
Private Sub cmdTrans_Click()
Me.ShowInTaskbar = False
Me.BorderStyle = 0
'// Make the form transparent
SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
'// Put it on top
SetWindowPos Me.hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, SWP_SHOWME
End Sub
------
--
mvh
Jens Vestergaard (mailadr i dette indlæg er ikke gyldig!)
www.railsoft.dk
Døgnets jernbanenyheder:
www.railsoft.dk/medier.asp