以下是我的代码.
看了一个似乎是msdn上的文章.. 【程序编程相关:DataGrid常见关注问题解决方案】 【推荐阅读:PHP 5.0 Pear安装方法】大致看了下, 很不幸....不知道是不是这文章作者太武断..还是真的.net翅膀还没长硬... 【扩展信息:(转载)SQL Injection (資】 (我的e文很差,要是译错的地方,大家装做不知道就好了,给点面子哈...) 上面说到:“如果想在control box (system) menu上添加新项, 用.net本身的代码是没有办法实现的.很幸运的,无论如何,用一点windowsapi可以得到一样的结果.“.... (牢骚: 靠.....这还叫幸运?????????????? 如果高级功能都用api的话,还要c#的.winform做啥呢???????????) first, you need to include the system.runtime.interopservices namespace: (第一步,你需要包含 system.runtime.interopservices 命名空间. ) next, define the functions necessary to add items to the system menu: (接下来,定义...添加项目到系统菜单中...所必需的函数....) 也就是: [c# .net] [dllimport("user32.dll")] private static extern int getsystemmenu(int hwnd, int brevert); [dllimport("user32.dll")] private static extern int appendmenu(int hmenu, int flagsw, int idnewitem, string lpnewitem); [visual basic .net] private declare function getsystemmenu lib "user32.dll" (byval hwnd as integer, _ byval brevert as integer) as integer private declare function appendmenu lib "user32.dll" alias "appendmenua" (byval hmenu as integer, _ byval flagsw as integer, idnewitem as integer, byval lpnewitem as string) as integer ... 下一页