BP Forums
Areo / Glass effect - Printable Version

+- BP Forums (https://bpforums.info)
+-- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=55)
+--- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=56)
+---- Forum: VB.NET (Visual Basic 2010/2008) (https://bpforums.info/forumdisplay.php?fid=8)
+----- Forum: Code Snippets (https://bpforums.info/forumdisplay.php?fid=18)
+----- Thread: Areo / Glass effect (/showthread.php?tid=651)



Areo / Glass effect - brco900033 - 09-19-2012

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]


Re: Areo / Glass effect - Vinwarez - 09-19-2012

Could you post a screenshot of the effect?


Re: Areo / Glass effect - Snake_eyes - 11-16-2012

This link provides what i consider to be a better Aero / Glass effect. Check it out
http://www.codeproject.com/Articles/38780/Glass-Effect-Extender-Library-for-your-Application

I've used it in the past and it's prety cool