0

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

2
Contributors
2
Replies
4
Views
11 Years
Discussion Span
Last Post by maheshsayani
0
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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.