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);
}
相關文章
C#實現控制Windows系統(tǒng)關機、重啟和注銷的方法
這篇文章主要介紹了C#實現控制Windows系統(tǒng)關機、重啟和注銷的方法,涉及C#調用windows系統(tǒng)命令實現控制開機、關機等操作的技巧,非常簡單實用,需要的朋友可以參考下2015-04-04unity AudioSource播放完聲音后要執(zhí)行的函數或條件操作
這篇文章主要介紹了unity AudioSource播放完聲音后要執(zhí)行的函數或條件操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2021-04-04C#提示:“在證書存儲區(qū)中找不到清單簽名證書”的解決方法
這篇文章主要介紹了C#提示:“在證書存儲區(qū)中找不到清單簽名證書”的解決方法,分析了幾種常見的解決方案供大家選擇使用,具有一定參考借鑒價值,需要的朋友可以參考下2015-01-01