C# WinForm 編譯程序並運行,窗體陰影效果

const int CS_DROPSHADOW = 0x20000;html

        constint GCL_STYLE = (-26);ide

        //聲明Win32 APIthis

        [DllImport("user32.dll", CharSet = CharSet.Auto)]spa

        publicstatic extern int SetClassLong(IntPtrhwnd, int nIndex, intdwNewLong);htm

        [DllImport("user32.dll", CharSet = CharSet.Auto)]blog

        public static extern int GetClassLong(IntPtrhwnd, int nIndex);get

//調用it

SetClassLong(this.Handle, GCL_STYLE, GetClassLong(this.Handle, GCL_STYLE) | CS_DROPSHADOW);class

相關頁面:http://hi.baidu.com/xiangboren/blog/item/5eafe2240a5aa4308644f96e.htmlstatic