|
-
Dec 1st, 2003, 02:13 PM
#1
Thread Starter
Addicted Member
Form transparent?
how would i set the form transparent? (but i still want to be able to see the forms picture which is a transparent GIF image, i just want the bits of the form i can see to be transparent.
please give in detail as this need to be done very quickly and im not that advanced in VB.
cheers
-
Dec 1st, 2003, 02:28 PM
#2
Frenzied Member
search the forums. This has been asked before.
-
Dec 1st, 2003, 02:29 PM
#3
Hyperactive Member
This has been answered many times before, but here ya go anyway.
VB Code:
Const LWA_COLORKEY = &H1
Const LWA_ALPHA = &H2
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000
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 Sub Form_Load()
'KPD-Team 2000
'URL: [url]http://www.allapi.net/[/url]
Dim Ret As Long
'Set the window style to 'Layered'
Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
'Set the opacity of the layered window to 128
SetLayeredWindowAttributes Me.hWnd, 0, 128, LWA_ALPHA
End Sub
-
Dec 1st, 2003, 02:36 PM
#4
Thread Starter
Addicted Member
thanks but that sets the whole form translucent, how would i set just the form backcolor transparent but still be able to see the forms picture Opaque?
(the forms backcolor is &H8000000F& if that helps?)
-
Dec 1st, 2003, 02:37 PM
#5
Frenzied Member
-
Dec 2nd, 2003, 03:58 AM
#6
Frenzied Member
maybe he has searched the forums. instead of taking time to say someone has a fault, why don't you take that same time and maby give a link to the thread that YOU know exists? Why not give this man a fishing rod instead of shutting the door in his face? It's possible the threads you all have seen arent being pulled by his search methods. I for one don't have all night to search so that's why I take advantage to the reason forums were created: to ask questions.
My opinion is you shouldn't answer at all if you're not going to help.
Last edited by Andy; Dec 5th, 2003 at 09:04 PM.
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
|