当前位置: 移动技术网 > IT编程>开发语言>c# > C#编程实现带有Aero效果的窗体示例

C#编程实现带有Aero效果的窗体示例

2019年07月18日  | 移动技术网IT编程  | 我要评论

本文实例讲述了c#编程实现带有aero效果的窗体。分享给大家供大家参考,具体如下:

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;
}

更多关于c#相关内容感兴趣的读者可查看本站专题:《c#窗体操作技巧汇总》、《c#数据结构与算法教程》、《c#常见控件用法教程》、《c#面向对象程序设计入门教程》及《c#程序设计之线程使用技巧总结

希望本文所述对大家c#程序设计有所帮助。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网