How To Make A Aero Form In VB.NET

Today i will teach you how to make a aero form in visual basic 2008 / visual basic 2010 but for this program you should have Microsoft Windows Vista or Microsoft Windows 7 so remember you should have one of these operating systems . this is a very simple tutorial and this thing is pretty awesome you will love it . now lets start the work

1 . Now open visual basic 2008 / visual basic 2010
2 . create a new project name it whatever you want
3 . double click on your form
4 . delete everything in the code and paste this


Imports System.Runtime.InteropServices

Public Class Form1
     Public Structure MARGINS
        Public LeftWidth As Integer
        Public RightWidth As Integer
        Public TopHeight As Integer
        Public Buttomheight As Integer
    End Structure

     Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As MARGINS) As Integer
    End Function

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Me.BackColor = Color.Black
            Dim margins As MARGINS = New MARGINS
            margins.LeftWidth = -1
            margins.RightWidth = -1
            margins.TopHeight = -1
            margins.Buttomheight = -1
            Dim result As Integer = DwmExtendFrameIntoClientArea(Me.Handle, margins)
        Catch ex As Exception
            MsgBox("you don't have aero enabled", vbCritical, "Fatal Error")
            Application.Exit()
        End Try
    End Sub
End Class
6 . now click debug and you are done