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函数加载,实现窗体边框阴影效果
            }
        }
    }

  • 相关阅读:
    iframe
    # ? & 号在url中的的作用
    面向对象和面向过程
    dom
    DOM对象与jquery对象有什么不同
    绑定js
    leetcode — search-for-a-range
    leetcode — search-for-a-range
    leetcode — search-in-rotated-sorted-array
    leetcode — longest-valid-parentheses
  • 原文地址:https://www.cnblogs.com/huangcong/p/1697088.html
Copyright © 2011-2022 走看看