c#中如何实现无边框的窗口aero效果,我把窗口的FormBorderStyle属性改为None,
c#中如何实现无边框的窗口aero效果,我把窗口的FormBorderStyle属性改为None,但想要实现显示窗口内内容也是AERO效果,类似于“迅雷”的皮肤,感谢这位...
c#中如何实现无边框的窗口aero效果,我把窗口的FormBorderStyle属性改为None,但想要实现显示窗口内内容也是AERO效果,类似于“迅雷”的皮肤,感谢这位大神的帮助。
展开
1个回答
展开全部
//代码来自代码中国
using System.Runtime.InteropServices;//引用,放在哪不用说了吧....
[DllImport("dwmapi.dll")]
public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarinset);
[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
public int Right;
public int left;
public int Top;
public int Bottom;
}
private void Form1_Load(object sender, EventArgs e)
{
this.BackgroundImage = null;
MARGINS margins = new MARGINS();
margins.left = -1;
margins.Right = -1;
margins.Top = -1;
margins.Bottom = -1;
IntPtr hwnd = Handle;
int result = DwmExtendFrameIntoClientArea(hwnd, ref margins);
this.BackColor = Color.Black;
this.label1.Text = "大家好!我是落落。。。";
this.label1.BackColor = Color.Transparent;
this.label1.ForeColor = Color.White;
}
追问
亲,我说的是无边框的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询