C# 无边框窗体边框阴影效果的简单实现
通过下面代码在构造函数中调用方法 SetShadow();
即可实现无边框窗体的阴影效果了
需要添加命名空间 using System.Runtime.InteropServices;
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);
}
相关文章
unity AudioSource播放完声音后要执行的函数或条件操作
这篇文章主要介绍了unity AudioSource播放完声音后要执行的函数或条件操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧2021-04-04
最新评论