Feedback

VB.Net Glas Form auf die Andere Art

Sprache: VB

Ich habe hier eine etwas andere art der Windows Form einfach nur eine neue form erstellen und den code durch den volgenden ersetzen.
Imports System.Runtime.InteropServices

Public Class Form1
    <StructLayout(LayoutKind.Sequential)> _
    Private Structure DWM_BLURBEHIND
        Public dwFlags As Integer
        Public fEnable As Boolean
        Public hRgnBlur As IntPtr
        Public fTransitionOnMaximized As Boolean
    End Structure

    Private Const DWM_BB_ENABLE As Integer = &H1
    Private Const DWM_BB_BLURREGION As Integer = &H2
    Private Const DWM_BB_TRANSITIONONMAXIMIZED As Integer = &H4

    <DllImport("dwmapi.dll", PreserveSig:=False)> _
    Private Shared Sub DwmEnableBlurBehindWindow(ByVal hWnd As IntPtr, ByRef pBlurBehind As DWM_BLURBEHIND)
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.BackColor = Color.Black
        Dim bb As DWM_BLURBEHIND
        bb.dwFlags = DWM_BB_ENABLE
        bb.fEnable = True
        bb.hRgnBlur = Nothing
        DwmEnableBlurBehindWindow(Me.Handle, bb)
    End Sub
End Class
Imports System.Runtime.InteropServices

Public Class Form1
    <StructLayout(LayoutKind.Sequential)> _
    Private Structure DWM_BLURBEHIND
        Public dwFlags As Integer
        Public fEnable As Boolean
        Public hRgnBlur As IntPtr
        Public fTransitionOnMaximized As Boolean
    End Structure

    Private Const DWM_BB_ENABLE As Integer = &H1
    Private Const DWM_BB_BLURREGION As Integer = &H2
    Private Const DWM_BB_TRANSITIONONMAXIMIZED As Integer = &H4

    <DllImport("dwmapi.dll", PreserveSig:=False)> _
    Private Shared Sub DwmEnableBlurBehindWindow(ByVal hWnd As IntPtr, ByRef pBlurBehind As DWM_BLURBEHIND)
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.BackColor = Color.Black
        Dim bb As DWM_BLURBEHIND
        bb.dwFlags = DWM_BB_ENABLE
        bb.fEnable = True
        bb.hRgnBlur = Nothing
        DwmEnableBlurBehindWindow(Me.Handle, bb)
    End Sub
End Class