WinForm 不规则窗体添加任务栏右键菜单

代码均是写在partial class Form1 : Form{}代码块之间

View Code
const int WS_CLIPCHILDREN = 0x2000000;
const int WS_MINIMIZEBOX = 0x20000;
const int WS_MAXIMIZEBOX = 0x10000;
const int WS_SYSMENU = 0x80000;
const int CS_DBLCLKS = 0x8;

protected override CreateParams CreateParams
{
    get
    {
        CreateParams cp = base.CreateParams;
        cp.Style = WS_CLIPCHILDREN | WS_MINIMIZEBOX | WS_SYSMENU;
        cp.ClassStyle = CS_DBLCLKS;
        return cp;
    }
}
posted @ 2012-12-07 00:16  zxin  阅读(668)  评论(0编辑  收藏  举报