|
-
Nov 12th, 2000, 02:03 AM
#1
Thread Starter
Junior Member
Hi,
how can i make my form has the same backcolor that whatever is behind it... like a transparent effect....
Thanks. ^_^
-
Nov 12th, 2000, 02:39 AM
#2
Code:
Public Const GWL_EXSTYLE = (-20)
Public Const WS_EX_TRANSPARENT = &H20&
Public Const SWP_FRAMECHANGED = &H20
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_SHOWME = SWP_FRAMECHANGED Or _
SWP_NOMOVE Or SWP_NOSIZE
Public Const HWND_NOTOPMOST = -2
Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
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 Form_Activate()
SetWindowLong Me.hwnd, GWL_EXSTYLE, _
WS_EX_TRANSPARENT
SetWindowPos Me.hwnd, HWND_NOTOPMOST, _
0&, 0&, 0&, 0&, SWP_SHOWME
End Sub
-
Nov 12th, 2000, 04:17 PM
#3
Matthew Gates: You cannot have a Public const or function in a Form module. If you want it to be public, you must place it in a Standard Module, orif you want to keep it in the Form, declare it as Private.
Code:
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const GWL_EXSTYLE = (-20)
Const WS_EX_TRANSPARENT = &H20&
Private Sub Form_Activate()
SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
End Sub
-
Nov 17th, 2000, 12:22 AM
#4
Thread Starter
Junior Member
Thanks a lot!!
Ok, i have to thank you, both codes were so useful, thank you ^_^\/
I hope someday i can help you.
Thks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|