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

}

}

}

}

[转]WinForm实现win7 Aero磨砂效果介绍的更多相关文章

  1. C# WinForm实现Windows 7 Aero磨砂玻璃效果

    在Vista系统之后,微软为窗体程序提供了Aero磨砂的效果,如下图.那么用C#如 何来实现这种磨砂效果呢? 代码: using System; using System.Collections.Ge ...

  2. C# WinForm判断Win7下是否是管理员身份运行

    原文:C# WinForm判断Win7下是否是管理员身份运行 如果程序不是以管理员身份运行,操作本地文件会提示:System.UnauthorizedAccessException异常 Vista 和 ...

  3. 如何在pyqt中实现窗口磨砂效果

    磨砂效果的实现思路 这两周一直在思考怎么在pyqt上实现窗口磨砂效果,网上搜了一圈,全都是 C++ 的实现方法.正好今天查python的官方文档的时候看到了 ctypes 里面的 HWND,想想倒不如 ...

  4. 【转】MFC 迅雷七窗体特效,使用DWM实现Aero Glass效果

    从Windows Vista开始,Aero Glass效果被应用在了Home Premium以上的系统中(Home Basic不具有该效果).这种效果是由DWM(Desktop Window Mana ...

  5. 窗口玻璃特效,半透明窗口,使用DWM实现Aero Glass效果

    转自:http://blog.csdn.net/ntwilford/article/details/5656633 从Windows Vista开始,Aero Glass效果被应用在了Home Pre ...

  6. winform实现图片的滑动效果

    使用winform实现图片的滑动效果(类似网站首页图片滑动切换效果),结果实现了,但是效果其实不是很理想.也许有更好的方法.         Timer timerSlide = null; //当前 ...

  7. Winform开发框架之权限管理系统功能介绍

    权限管理系统的重要特性总结: 1) 高度集成的权限系统.独立模块,能快速整合使用.2) 符合权限的国际通用标准,基于RBAC(基于角色的访问控制)的角色权限控制.3) 多数据库架构支持,内置支持Sql ...

  8. 如何在pyqt中实现亚克力磨砂效果的QLabel

    前言 Windows10 在 UWP 应用中支持亚克力画刷,可以在部件的底部绘制亚克力效果的背景图.下面我们使用 QLabel 来模拟这个磨砂过程. 实现方法 MSDN 文档中介绍了亚克力材料的配方, ...

  9. Java Web开发框架Spring+Hibernate整合效果介绍(附源码)

    最近花了一些时间整合了一个SpringMVC+springAOP+spring security+Hibernate的一套框架,之前只专注于.NET的软件架构设计,并没有接触过Java EE,好在有经 ...

随机推荐

  1. php 取某一日期的前一天

    代码为: $date = “2009-01-01”;$time = strtotime($date) – 3600*24;echo date(‘Y-m-d’,$time); 或者一句:echo dat ...

  2. 19.SimLogin_case03

    # 模拟登录GitHub import requests from lxml import etree class Login(): def __init__(self): self.headers ...

  3. layui表格监听开关并获取改行id

    ,{field:'sex', title:'性别', width:85, templet: '#switchTpl', unresize: true} <script type="te ...

  4. Spring - JUnit整合测试

    1.导包:test.jar - (依赖 aop.jar) 2.使用@RunWith注解创建spring容器 - @RunWith(SpringJUnit4ClassRunner.class) 3.使用 ...

  5. Web开发之Tomcat&Servlet

    <!doctype html>01 - JavaEE - Tomcat&Servlet figure:first-child { margin-top: -20px; } #wri ...

  6. Carthage使用

    # carthage 包管理 ## 安装过程 1) 安装homebrew ``` ruby$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githu ...

  7. Shuffle过程详解

  8. CodeForces - 27E

    https://vjudge.net/problem/CodeForces-27E 求因子个数为n的最小的数dfs枚举质因子的幂 #include <iostream> #include ...

  9. ActiveMQ 知识点

    消息队列高可用 持久化,事务,签收,zookeeper+replicated-leveldb-store的主从集群 异步发送 同步发送: 明确指定同步发送 未使用事务的前提下,发送持久化消息(会使用同 ...

  10. Tensorflow入门篇

     参考Tensorflow中文网(http://www.tensorfly.cn/tfdoc/get_started/introduction.html) ,写一个入门. 1.打开pyCharm,新建 ...