By default, the form has a limited size title area to which the aero-glass effect is applied. I'd like to increase that area, not only at the title, but at the bottom and the sides of my form. scheme

有帮助吗?

解决方案

Use DwmExtendFrameIntoClientArea:

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

[DllImport("user32.dll")]
public static extern IntPtr DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarInset);

Call DwmExtendFrameIntoClientArea with your form's Handle and a MARGINS structure. Just set Left, Right, Top and Bottom to the amount you want the respective borders extended by.

Oh, and set the BackColor of your form to Black. (Thanks, @HansPassant!)

Sorry if I got the extern syntax wrong. I haven't ever done this in C#...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top