【问题标题】:C#: Glass Forms?C#:玻璃形式?
【发布时间】:2011-07-05 03:08:52
【问题描述】:

如何使用航空玻璃覆盖我的整个表格?这是我的意思的一个例子:

【问题讨论】:

    标签: c# windows winforms themes aero


    【解决方案1】:
    [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, ref marg);
    

    【讨论】:

    • 谢谢,这成功了。您应该修复结构,使其位于代码标签中。
    • 酷。顺便说一句,marg 应该作为ref 传递给DwmExtendFrameIntoClientArea(即DwmExtendFrameIntoClientArea(form.Handle, ref marg);
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-23
    • 2015-01-13
    • 1970-01-01
    相关资源
    最近更新 更多