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]
#2
Could you post a screenshot of the effect?
Also known as Rocketalypse.
System.out.println("I prefer Java.");
#3
This link provides what i consider to be a better Aero / Glass effect. Check it out
http://www.codeproject.com/Articles/3878...pplication

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


Forum Jump:


Users browsing this thread: 1 Guest(s)