zoukankan      html  css  js  c++  java
  • 黄聪:C# 窗体边框阴影效果

    这只是一个微小的窗体特效,但有时也会有画龙点睛之效。

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;

    namespace winForm
    {
        public partial class Form1 : Form
        {
            #region 窗体边框阴影效果变量申明

            const int CS_DropSHADOW = 0x20000;
            const int GCL_STYLE = (-26);
            //声明Win32 API
            [DllImport("user32.dll", CharSet = CharSet.Auto)]
            public static extern int SetClassLong(IntPtr hwnd, int nIndex, int dwNewLong);
            [DllImport("user32.dll", CharSet = CharSet.Auto)]
            public static extern int GetClassLong_r(IntPtr hwnd, int nIndex);

            #endregion

            public Form1()
            {
                InitializeComponent();
                SetClassLong(this.Handle, GCL_STYLE, GetClassLong_r(this.Handle, GCL_STYLE) | CS_DropSHADOW); //API函数加载,实现窗体边框阴影效果
            }
        }
    }

  • 相关阅读:
    团队项目-选题报告
    第一次结对编程作业
    第一次个人编程作业
    软工作业1
    总结
    2013-2014 ACM ICPC Central European Regional Contest (CERC 13) K-Digraphs
    2018CCPC吉林赛区 F
    计蒜客-A1594 封印之门
    HDU-1599 find the mincost route
    POJ-2240 Arbitrage
  • 原文地址:https://www.cnblogs.com/huangcong/p/1697088.html
Copyright © 2011-2022 走看看