🙂 [Tutorial] Windows Vista/7 Glass Window
NextGenEdit: Original Code By DFXBB's
Hi !
One of the most coolest features of Windows Vista/7 is its glass effect in Forms.
In this short tutorial I'll show you how to make your form entirely transparent. The difference is that by default Windows do transparency in title bar. But we can change that and apply the transparency to complete Form.
Here we go:
Create a new project.
Add this namespace:
Then add this:
Then declare the following API:
Note: The following API is only present in Windows Vista /7
Now Double Click The Form and add the following code:
Note: Transparency will not turned on unless you change the Form's back color to Black.
Credits: MSDN for API DwmExtendFrameIntoClientArea Function (Windows)
Here's a screen shot:

Greetz, MJLover
Hi !
One of the most coolest features of Windows Vista/7 is its glass effect in Forms.
In this short tutorial I'll show you how to make your form entirely transparent. The difference is that by default Windows do transparency in title bar. But we can change that and apply the transparency to complete Form.
Here we go:
Create a new project.
Add this namespace:
Code:
Imports System.Runtime.InteropServices
Code:
'This will declare margins for transparency of our window...
<StructLayout(LayoutKind.Sequential)> _
Public Structure WinMargins
Public LWidth As Integer
Public THeight As Integer
Public RWidth As Integer
Public BHeight As Integer
End Structure
Note: The following API is only present in Windows Vista /7
Code:
<DllImport("dwmapi.dll")> _
Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As WinMargins) As Integer
End Function
Code:
Dim margins As WinMargins = New WinMargins
'The value of -1 is used when you want to use full window as transparency...
Dim WM As WinMargins = New WinMargins
WM.LWidth = -1
WM.RWidth = -1
WM.THeight = -1
WM.BHeight = -1
'The handle of your window..
Dim handle As IntPtr = Me.Handle
' Finally call the API function by inputing window handle and your window margins ..
DwmExtendFrameIntoClientArea(handle, WM)
Credits: MSDN for API DwmExtendFrameIntoClientArea Function (Windows)
Here's a screen shot:

Greetz, MJLover





lol