欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C# 無邊框窗體邊框陰影效果的簡單實(shí)現(xiàn)

 更新時(shí)間:2013年10月08日 14:31:22   作者:  
這篇文章介紹了C# 無邊框窗體邊框陰影效果的簡單實(shí)現(xiàn),有需要的朋友可以參考一下

通過下面代碼在構(gòu)造函數(shù)中調(diào)用方法 SetShadow();

即可實(shí)現(xiàn)無邊框窗體的陰影效果了

需要添加命名空間 using System.Runtime.InteropServices;

復(fù)制代碼 代碼如下:

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

相關(guān)文章

最新評(píng)論