vb.net aero effect code

Upload: mhar-daniel

Post on 07-Aug-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/20/2019 Vb.net Aero Effect Code

    1/1

    Imports System.Runtime.InteropServices

    Public Class AeroEffectTutorial

      _   Public Structure MARGINS

      Public Destra As Integer  Public Sinistra As Integer  Public Su As Integer  Public Giu As Integer

      End Structure

      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}

      Private Sub AeroEffectTutorial_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