首页 > Windows开发 > 详细

C# 无边框窗体边框阴影效果的简单实现

时间:2014-10-09 14:03:36      阅读:397      评论:0      收藏:0      [点我收藏+]

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();

C# 无边框窗体边框阴影效果的简单实现

原文:http://www.cnblogs.com/FLWL/p/4013172.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!