| 发表于:2007-01-12 14:57:204楼 得分:15 |
要想让窗体显示后不可移动(锁定位置)可以参考下代码来操作(用api): [dllimport( "user32.dll ")] public static extern int getsystemmenu(int hwnd, int brevert); [dllimport( "user32.dll ")] public static extern int removemenu(int 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_move = 0xf010; protected override void onload(eventargs e) { int hmenu; hmenu = getsystemmenu(this.handle.toint32(), 0); //移动菜单 removemenu(hmenu, sc_move, mf_bycommand ¦ mf_disabled ¦ mf_grayed); } | | |
|