2012年5月15日

.Net WinForm 控件键盘消息处理剖析

摘要: 在WinForm控件上我们可以看到很多关于键盘消息处理的方法,比如OnKeyDown, OnKeyPress, ProcessCmdKey, ProcessDialogKey,IsInputKey等等,那么这些方法是如何被组织的,每一个方法的具体含义又是什么哪?Win32的键盘消息又是如何到达控件上的这些方法的,本文将着重阐述这些问题,对.Net WinForm控件的键盘消息处理过程进行剖析。 1.WinForm消息循环大家都知道WinForm也是依赖于底层的消息机制的,通常我们的WinForm应用程序会以如下方式启动:Code highlighting produced by Actipro 阅读全文

posted @ 2012-05-15 11:30 刺客mrchenzh 阅读(199) 评论(0) 推荐(0) 编辑

ProcessCmdKey

摘要: http://msdn.microsoft.com/en-us/library/7tas5c80.aspx当你在使用此自定义的DataGridView日历列时,可能会想要在编辑日历单元格的时候点击Tab键不结束编辑,这时你就可以重写一下CalendarEditingControl.ProcessCmdKey方法来截获按键。如果你只是想不做任何处理,那么你大可以直接返回true在你判断当前按键是Tab。 protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { i... 阅读全文

posted @ 2012-05-15 11:20 刺客mrchenzh 阅读(498) 评论(0) 推荐(0) 编辑

C#与C++类型对应 (转)

摘要: http://blog.csdn.net/zhouzhangkui/archive/2010/05/30/5635398.aspxview plaincopy to clipboardprint?C#与C++之间类型的对应 Windows Data Type .NET Data Type BOOL, BOOLEAN Boolean or Int32 BSTR String BYTE Byte CHAR Char DOUBLE Double DWORD Int32 or UInt32 FLOAT Single HANDLE (and all other handle types, such as 阅读全文

posted @ 2012-05-15 10:26 刺客mrchenzh 阅读(204) 评论(0) 推荐(1) 编辑

Probably more than you want to know about keyboarding in Windows Forms

摘要: The reason why keyboard handling is so complex, is because, well it’s just complex. Before a control can get called on the OnKeyDown/Press/Up event, we need to filter out several things Shortcuts which execute menu commands (e.g. Control+O on a MenuItem)Navigational keys which shift focus (Tab, arro 阅读全文

posted @ 2012-05-15 10:25 刺客mrchenzh 阅读(354) 评论(0) 推荐(0) 编辑

导航