-
Mar 17th, 2008, 05:25 PM
#1
Thread Starter
Junior Member
[RESOLVED] VB6 TRANSPARENT background
Last edited by bim11; Jun 3rd, 2008 at 03:21 PM.
-
Mar 17th, 2008, 11:07 PM
#2
Thread Starter
Junior Member
Re: VB6 TRANSPARENT background
-
Mar 18th, 2008, 05:13 AM
#3
Re: VB6 TRANSPARENT background
100% is easy.
Add any controls you want. For Labels to be transparent set their BackColor to match the one we set the Form to here:
Code:
Option Explicit
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
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const LWA_COLORKEY = &H1&
Private Const LWA_ALPHA = &H2&
Private Sub Form_Load()
'Set the Form transparent by color.
BackColor = RGB(127, 127, 0) 'Unique but explicit (non-system) color.
SetWindowLong hWnd, _
GWL_EXSTYLE, _
GetWindowLong(hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED
SetLayeredWindowAttributes hWnd, BackColor, 0, LWA_COLORKEY
End Sub
-
Mar 18th, 2008, 05:15 AM
#4
Thread Starter
Junior Member
Re: VB6 TRANSPARENT background
Last edited by bim11; Jun 3rd, 2008 at 03:21 PM.
-
Mar 18th, 2008, 05:50 AM
#5
Re: VB6 TRANSPARENT background
Yes I think so, but it won't work on anything less than Win2k. Look up the APIs at MSDN if your unsure.
-
Mar 18th, 2008, 05:53 AM
#6
Re: VB6 TRANSPARENT background
-
Mar 31st, 2008, 06:56 PM
#7
New Member
Re: [RESOLVED] VB6 TRANSPARENT background
Thanks ... dilettante ... you are ......Great............
it's not only transparent form , but also .... click- through .
i tried it on XP .. it works great ........
Very Great Job
-
Mar 31st, 2008, 09:22 PM
#8
Re: [RESOLVED] VB6 TRANSPARENT background
I got inspired when a guy somewhere else said "only in .Net!"
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
|