Hi all
I have made my forms and its contents semi transparent but i want to make my controls transparent not my form how can i do this. I m using the following code to setting transperency to my form.
[code]
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 Const GWL_STYLE = (-16)
Private Const GWL_EXSTYLE = (-20)
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 LWA_COLORKEY = &H1
Private Const LWA_ALPHA = &H2
Private Const WS_EX_LAYERED = &H80000
Private m_lAlpha As Long
Private Sub Form_Load()
m_lAlpha = 255
If Settings.chkTrans.Value = 1 Then
If (m_lAlpha = 255) Then
Dim lStyle As Long
lStyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
lStyle = lStyle Or WS_EX_LAYERED
SetWindowLong Me.hwnd, GWL_EXSTYLE, lStyle
End If
Dim lAlpha
m_lAlpha = m_lAlpha - 10
lAlpha = m_lAlpha
If (lAlpha < 0) Then
lAlpha = 0
End If
SetLayeredWindowAttributes Me.hwnd, 0, lAlpha, LWA_ALPHA
End If
End Sub