标签:style ar sp on 代码 ad new bs as
private const int CS_DropSHADOW = 0x20000; private const int GCL_STYLE = (-26); [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(IntPtr hwnd, int nIndex);
private void SetShadow() { SetClassLong(this.Handle, GCL_STYLE, GetClassLong(this.Handle, GCL_STYLE) | CS_DropSHADOW); }
需要添加命名空间 using System.Runtime.InteropServices;
通过下面代码在构造函数中调用方法 SetShadow();
标签:style ar sp on 代码 ad new bs as
原文地址:http://www.cnblogs.com/FLWL/p/4013172.html