摘要: 1.、WM_DEVICECHANGE :驱动器加载时是发送WM_DEVICECHANGE消息,但是判断驱动器是加载还是卸载就要判断WPARAM字段是DEVICEARRIVE还是DEVICEMOVE。DEVICECHANGE0X219DEVICEARRVIE0X8000DEVICEREMOVE0X8004 WM_NULL = 0x0000, WM_CREATE = 0x0001, WM_DESTROY = 0x0002, WM_MOVE = 0x0003, WM_SIZE = 0x0005, WM_ACTIVATE = 0x0006, WM_SETFOCUS = 0x0007, ... 阅读全文
posted @ 2013-12-30 15:43 青田 阅读(671) 评论(0) 推荐(0) 编辑
摘要: usingSystem.Runtime.InteropServices;[DllImport("user32.dll")]publicstaticexternboolReleaseCapture();[DllImport("user32.dll")]publicstaticexternboolSendMessage(IntPtrhwnd,intwMsg,intwParam,intlParam);publicconstintWM_SYSCOMMAND=0x0112;publicconstintSC_MOVE=0xF010;publicconstintHTC 阅读全文
posted @ 2013-12-19 11:55 青田 阅读(1113) 评论(0) 推荐(0) 编辑
摘要: c# 里面隐藏了form 的边框,任务栏就没有了系统菜单。如何显示呢,看下文。调用方式 在form 构造函数 或者load中 TaskMenu.ShowSYSMENU(this);[DllImport("user32.dll" ,EntryPoint="GetWindowLong" ,CharSet=CharSet.Auto)]private static extern int GetWindowLong(HandleRefhWnd,int nIndex);[DllImport("user32.dll" ,EntryPoint=&qu 阅读全文
posted @ 2013-12-18 20:28 青田 阅读(1577) 评论(1) 推荐(0) 编辑
摘要: 问题提出:对于普通应用程序,我们很多时候会将窗口最小化到系统托盘。当我们点击这个托盘图标时,可能会弹出一些友好的提示界面,可以恰当的进行一些操作。一般情况下,我们可能粗暴的将这个友好提示界面放置在桌面的右下角,对于XP,这是OK的,因为XP不允许我们将任务栏拖动到桌面的上、左、右三个方向,只允许停靠下桌面的最下方,但是对于win7,我们便需要考虑到其它三个方向,再根据这个方向确定好提示界面放的位置。那么,如何获得任务栏的位置及相关信息?windows提供了相关和API进行操作。UINT_PTR SHAppBarMessage(DWORD dwMessage,PAPPBARDATA pData) 阅读全文
posted @ 2013-12-18 18:02 青田 阅读(621) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 不包含任务栏的屏幕尺寸 4 int width = System.Windows.Forms.SystemInformation.WorkingArea.Width; 5 int height = System.Windows.Forms.SystemInformation.WorkingArea.Height; 6 7 包括任务栏的屏幕尺寸 8 9 int width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;10 int height = System.Windows.Forms.Screen... 阅读全文
posted @ 2013-12-18 17:52 青田 阅读(612) 评论(0) 推荐(0) 编辑
摘要: 1 [DefaultEvent("Load"), InitializationEvent("Load"), ComVisible(true), ClassInterface(ClassInterfaceType.AutoDispatch), ToolboxItemFilter("System.Windows.Forms.Control.TopLevel"), ToolboxItem(false), DesignTimeVisible(false), Designer("System.Windows.Forms.Design. 阅读全文
posted @ 2013-12-18 12:12 青田 阅读(1219) 评论(0) 推荐(0) 编辑
摘要: 1.CellPainting: 在datagridview重绘的时候触发此事件2。RowPostPaint: 在单元格重绘之后触发此事件3.DataGridView.GetCellDisplayRectangle 方法 :返回表示单元格的显示区域的矩形。public Rectangle GetCellDisplayRectangle( int columnIndex, int rowIndex, bool cutOverflow) 阅读全文
posted @ 2013-11-29 14:40 青田 阅读(1094) 评论(0) 推荐(0) 编辑
摘要: 绑定下拉框数据元的链接地址:http://stackoverflow.com/questions/8711182/datagridivew-datagridviewcomboboxcolumn-select-value-member2down votefavoritei have datagridview which has one combobox column. i populate combobox column. when i select any text from combobox column then i need to get the value when i read th 阅读全文
posted @ 2013-11-29 10:29 青田 阅读(3023) 评论(0) 推荐(0) 编辑
摘要: 键盘事件有三种:keydown、keyup、keypresskeyup可以响应上下左右事件,而keydown,则不行 阅读全文
posted @ 2013-10-12 11:21 青田 阅读(394) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2013-08-26 15:21 青田 阅读(11) 评论(0) 推荐(0) 编辑