11

How can I use aero glass to cover my entire forms? Here is an example of what I mean:

enter image description here

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Nahydrin
  • 13,197
  • 12
  • 59
  • 101

1 Answers1

13
[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);

Then you can enable it on your form like so:

MARGINS marg = new MARGINS() { Left = -1, Right = -1, Top = -1, Bottom = -1 };
DwmExtendFrameIntoClientArea(form.Handle, ref marg);
Anders Forsgren
  • 10,827
  • 4
  • 40
  • 77
user828922
  • 146
  • 1
  • 5