• [转]WinForm实现win7 Aero磨砂效果介绍


    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);
    }
    }
    }
    }
  • 相关阅读:
    Integer的疑惑
    简单选择排序算法
    冒泡排序
    插入排序算法java
    BinaryOperator<T>接口的用法示例+BiFunction
    装箱和拆箱、类型比较
    java的Junit的用法(转发)
    htmlnav
    好用的壁纸网站大全
    c# 财务数据编号的生辰
  • 原文地址:https://www.cnblogs.com/qq1223558/p/3227120.html
Copyright © 2020-2023  润新知