WinForm实现win7 Aero磨砂效果如下:

WinForm实现win7 Aero磨砂效果代码如下:

using System;
using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.ServiceModel;

using System.Runtime.InteropServices;

namespace MyWeather

{

public partial class Form1 : Form

{

[StructLayout(LayoutKind.Sequential)]

public struct MARGINS

{

public int Left;

public int Right;

public int Top;

public int Bottom;

}

[DllImport("dwmapi.dll", PreserveSig = false)]

static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS margins);

[DllImport("dwmapi.dll", PreserveSig = false)]

static extern bool DwmIsCompositionEnabled();

public Form1()

{

InitializeComponent();

}

protected override void OnLoad(EventArgs e)

{

if (DwmIsCompositionEnabled())

{

MARGINS margins = new MARGINS();

margins.Right = margins.Left = margins.Top = margins.Bottom = this.Width + this.Height;

DwmExtendFrameIntoClientArea(this.Handle, ref margins);

}

base.OnLoad(e);

}

protected override void OnPaintBackground(PaintEventArgs e)

{

base.OnPaintBackground(e);

if (DwmIsCompositionEnabled())

{

e.Graphics.Clear(Color.Black);

}

}

}

}

最新文章

  1. C语言与java 20155317 王新玮第二次
  2. win7 ins 30131 oracle 12c
  3. Delphi 和 C++Builder 2014年及以后技术路线图
  4. 减少 WAF 漏报的 8 种方法 !
  5. 限制 UITextField 输入长度
  6. codeforces 505B Mr. Kitayuta's Colorful Graph(水题)
  7. Python学习-使用matplotlib画动态多图
  8. BestCoder 百度之星2016
  9. js的几大数据类型
  10. 【状压dp】Bzoj2064 分裂
  11. koa-ueditor上传图片到七牛
  12. 在原生Windows安装Keras
  13. C#隐藏与显示系统任务栏和开始菜单栏按钮
  14. 查看 Centos 7 的MAC 地址
  15. tp 内置压缩文件zip
  16. R中使用rvest爬取数据小试
  17. python+webdriver,选取Select下拉框中的值
  18. Unity创建或克隆对象 Instantiate()
  19. 【Python】进程和线程
  20. 【python】-- Django

热门文章

  1. MDK,关于 STM32F4 配置失败, GPIO, USART 写入值没反应
  2. floyd类型题UVa-10099-The Tourist Guide +Frogger POJ - 2253
  3. day 67 Django基础三之视图函数
  4. C# SQL 多条件查询技巧
  5. JS流程控制语句 反反复复(while循环) 和for循环有相同功能的还有while循环, while循环重复执行一段代码,直到某个条件不再满足。
  6. 【左偏树】[APIO2012]派遣
  7. Python全栈开发:DOM
  8. Python+Selenium基础入门及实践
  9. layui实现批量导入excal表
  10. [violet6] 故乡的梦