954,193 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Semi Transparrent Forms

Hi All
I Want To Create Semi Transparent Forms
I Had done work on Transparent forms but i need semi transparent form which we can see background text/image through this form in vb
please send me the solution for this

maheshsayani
Light Poster
45 posts since Jul 2006
Reputation Points: 10
Solved Threads: 2
 
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Long, ByVal dwFlags As Long) As Long


Public Const LWA_ALPHA = &H2&
Public Const GWL_EXSTYLE = (-20)
Public Const WS_EX_LAYERED = &H80000

Public Sub Phantomize_Window(hwnd As Long, bytOpacity)
'phantomize window
Dim buf As String * 1024
Call SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
Call SetLayeredWindowAttributes(hwnd, 0, bytOpacity, LWA_ALPHA)
End Sub


Phantomize_Window Me.hwnd, 65

Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

Thanks For Your Help Mr Comatose

maheshsayani
Light Poster
45 posts since Jul 2006
Reputation Points: 10
Solved Threads: 2
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You