Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Studio .NET transparent background

Status
Not open for further replies.

Snipor

Programmer
Feb 23, 2001
92
US
I heard there is a way to make the background in Visual Studio .net transparent so your desktop backgrounds show through. Anybody know how to do this? I guess you can do in in Visual Studion 6 also. Thanks Knowledge is Power......
 
Try this


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
then
Code:
    Dim lReturnVal As Long
    Dim iFadeLevel As Integer

    iFadeLevel = 128 ' or any value between 0 and 255
    lReturnVal = GetWindowLong(me.hWnd, GWL_EXSTYLE)
    lReturnVal = lReturnVal Or WS_EX_LAYERED
    SetWindowLong me.hWnd, GWL_EXSTYLE, lReturnVal 
    SetLayeredWindowAttributes Me.hWnd, 0, iFadeLevel , LWA_ALPHA


Oh this works on 2000 just fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top