C#:玻璃模板?

C#:玻璃模板?,c#,windows,winforms,themes,aero,C#,Windows,Winforms,Themes,Aero,如何使用aero玻璃覆盖整个表单?以下是我的意思的一个例子: [StructLayout(LayoutKind.Sequential)] public struct MARGINS { public int Left; public int Right; public int Top; public int Bottom; } [DllImport("dwmapi.dll")] public static extern int DwmExtendFrameInt

如何使用aero玻璃覆盖整个表单?以下是我的意思的一个例子:

[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
    public int Left;
    public int Right;
    public int Top;
    public int Bottom;
}

[DllImport("dwmapi.dll")]
public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMargins);

然后您可以在表单上启用它,如下所示:

MARGINS marg = new MARGINS() { Left = -1, Right = -1, Top = -1, Bottom = -1 };
DwmExtendFrameIntoClientArea(form.Handle, marg);

谢谢,这就成功了。您应该修复结构,使其位于code tags.Cool中。顺便说一句,
marg
应作为
ref
(即
dwmextendframeintoclienterea(form.Handle,ref-marg);
)传递给
dwmextendframeintoclienterea