| 发表于:2007-03-13 16:52:475楼 得分:0 |
参见如下的代码(使关闭控钮变灰而不是不显示): [dllimport( "user32.dll ")] public static extern intptr getsystemmenu(intptr hwnd, int brevert); [dllimport( "user32.dll ")] public static extern int removemenu(intptr hmenu, int nposition, int wflags); public const int mf_bycommand = 0x00000000; public const int mf_disabled = 0x00000002; public const int mf_grayed = 0x00000001; public const int sc_close = 0xf060; private void btnnoclosebtn_click(object sender, eventargs e) { intptr hmenu; hmenu = getsystemmenu(this.handle, 0); removemenu(hmenu, sc_close, mf_bycommand ¦ mf_disabled ¦ mf_grayed); } | | |
|