以下是我希望表单的外观:
这是我到目前为止所尝试的内容:
[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);
private void Form1_Load(object sender, EventArgs e)
{
MARGINS marg = new MARGINS() { Left = -1, Right = -1, Top = -1, Bottom = -1 };
DwmExtendFrameIntoClientArea(this.Handle, ref marg);
}
这确实使我的表格透明,但我似乎无法弄清楚如何制作圆角。