本文實例講述了C#編程實現(xiàn)帶有Aero效果的窗體。分享給大家供大家參考,具體如下:
using System.Runtime.InteropServices;//引用,放在哪不用說了吧....
[DllImport("dwmapi.dll")]
public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarinset);
[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
public int Right;
public int left;
public int Top;
public int Bottom;
}
private void Form1_Load(object sender, EventArgs e)
{
this.BackgroundImage = null;
MARGINS margins = new MARGINS();
margins.left = -1;
margins.Right = -1;
margins.Top = -1;
margins.Bottom = -1;
IntPtr hwnd = Handle;
int result = DwmExtendFrameIntoClientArea(hwnd, ref margins);
this.BackColor = Color.Black;
this.label1.Text = "。。。";
this.label1.BackColor = Color.Transparent;
this.label1.ForeColor = Color.White;
}
更多關(guān)于C#相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《C#窗體操作技巧匯總》、《C#數(shù)據(jù)結(jié)構(gòu)與算法教程》、《C#常見控件用法教程》、《C#面向?qū)ο蟪绦蛟O(shè)計入門教程》及《C#程序設(shè)計之線程使用技巧總結(jié)》
希望本文所述對大家C#程序設(shè)計有所幫助。
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!