[转]WinForm实现win7 Aero磨砂效果介绍
WinForm实现win7 Aero磨砂效果如下:
WinForm实现win7 Aero磨砂效果代码如下:
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);
}
}
}
}
最新文章
- C语言与java 20155317 王新玮第二次
- win7 ins 30131 oracle 12c
- Delphi 和 C++Builder 2014年及以后技术路线图
- 减少 WAF 漏报的 8 种方法 !
- 限制 UITextField 输入长度
- codeforces 505B Mr. Kitayuta's Colorful Graph(水题)
- Python学习-使用matplotlib画动态多图
- BestCoder 百度之星2016
- js的几大数据类型
- 【状压dp】Bzoj2064 分裂
- koa-ueditor上传图片到七牛
- 在原生Windows安装Keras
- C#隐藏与显示系统任务栏和开始菜单栏按钮
- 查看 Centos 7 的MAC 地址
- tp 内置压缩文件zip
- R中使用rvest爬取数据小试
- python+webdriver,选取Select下拉框中的值
- Unity创建或克隆对象 Instantiate()
- 【Python】进程和线程
- 【python】-- Django
热门文章
- MDK,关于 STM32F4 配置失败, GPIO, USART 写入值没反应
- floyd类型题UVa-10099-The Tourist Guide +Frogger POJ - 2253
- day 67 Django基础三之视图函数
- C# SQL 多条件查询技巧
- JS流程控制语句 反反复复(while循环) 和for循环有相同功能的还有while循环, while循环重复执行一段代码,直到某个条件不再满足。
- 【左偏树】[APIO2012]派遣
- Python全栈开发:DOM
- Python+Selenium基础入门及实践
- layui实现批量导入excal表
- [violet6] 故乡的梦