📜  .net 深色标题栏 - VBA 代码示例

📅  最后修改于: 2022-03-11 14:51:56.307000             🧑  作者: Mango

代码示例1
' Note: This is supported on Windows 10 and higher

Imports System.Runtime.InteropServices
    
Class Example
    
    
    Public Shared Function DwmSetWindowAttribute(hwnd As IntPtr, attr As Integer, ByRef attrValue As Integer, attrSize As Integer) As Integer
    End Function
    
    ' Use this line for WPF. Value of true makes the title bar dark, false is normal. Note that Me is the window you want to apply the dark title bar to
    InteropHelper.DwmSetWindowAttribute(New Interop.WindowInteropHelper(Me).Handle, 20, True, Runtime.InteropServices.Marshal.SizeOf(True))

    ' Use this line for Windows Forms. Value of true makes the title bar dark, false is normal. Note that Me is the form you want to apply the dark title bar to
    InteropHelper.DwmSetWindowAttribute(New Me.Handle, 20, True, Runtime.InteropServices.Marshal.SizeOf(True))

    
End Class