手机
当前位置:查字典教程网 >编程开发 >C#教程 >winform下实现win7 Aero磨砂效果实现代码
winform下实现win7 Aero磨砂效果实现代码
摘要:效果图:复制代码代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.C...

效果图:

winform下实现win7 Aero磨砂效果实现代码1

复制代码 代码如下:

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磨砂效果实现代码】相关文章:

c# 实现MD5,SHA1,SHA256,SHA512等常用加密算法源代码

c# winform取消右上角关闭按钮的实现方法

C# 注册表 操作实现代码

c# list部分操作实现代码

C#实现路由器断开连接,更改公网ip的实例代码

C#自动创建数据库实现代码

C# Dictionary的使用实例代码

C#中通过API实现的打印类 实例代码

WinForm中的登录实现

C# 邮件发送和接收实现代码

精品推荐
分类导航