Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Areo / Glass effect
#1
Here is a code to get the Aero/Glass effect on your forms. It only supports Windows 7 and Vista.

[code2=vbnet]Imports System.Runtime.InteropServices
Public Class Form1
Declare Auto Function DwmIsCompositionEnabled Lib "dwmapi.dll" Alias "DwmIsCompositionEnabled" (ByRef pfEnabled As Boolean) As Integer
Declare Auto Function DwmExtendFrameIntoClientArea Lib "dwmapi.dll" Alias "DwmExtendFrameIntoClientArea" (ByVal hWnd As IntPtr, ByRef pMargin As MARGINS) As Integer
Dim pMargins As New MARGINS With {.Su = -1, .Sinistra = -1, .Destra = -1, .Giu = -1}

<StructLayout(LayoutKind.Sequential)> _
Public Structure MARGINS
Public Destra As Integer
Public Sinistra As Integer
Public Su As Integer
Public Giu As Integer
End Structure

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim en As Boolean = False
DwmIsCompositionEnabled(en)
If en Then
DwmExtendFrameIntoClientArea(Me.Handle, pMargins)
End If
Me.TransparencyKey = Color.FromKnownColor(KnownColor.ActiveCaption)
Me.BackColor = Me.TransparencyKey
End Sub
End Class[/code2]


Messages In This Thread
Areo / Glass effect - by brco900033 - 09-19-2012, 03:20 AM
Re: Areo / Glass effect - by Vinwarez - 09-19-2012, 10:44 AM
Re: Areo / Glass effect - by Snake_eyes - 11-16-2012, 10:45 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)