<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_逍遥蜗居</title><subtitle type="text"/><id>http://feed.cnblogs.com/blog/u/22577/rss</id><updated>2011-08-28T12:36:40Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><generator>CNBlogs BlogServer</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/22577/rss"/><entry><id>http://www.cnblogs.com/happyexp/archive/2011/08/28/2156376.html</id><title type="text">c# DataGridView中键盘事件处理方法 转</title><summary type="text">本文引用至：http://hurt0759.blog.163.com/blog/static/6150904201008105614457/.Net 2.0中的DataGridView比前期版本的DataGrid功能强多了，但本人还是觉得有不足的地方。比如说其DataGridViewButtonColumn列，像这样的列好像在本人开发过的系统中没有太多的用(最重要的还是不能在其上编辑，可能是没找到方法吧，再研究)。还有DataGridViewComboBoxColumn列，看起来比较漂亮，将其放在实际中，其实下拉的基本是列表或弹出一Form进行选择，但还是有问题。得到的结果要是DataGrid</summary><published>2011-08-28T12:37:00Z</published><updated>2011-08-28T12:37:00Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><link rel="alternate" href="http://www.cnblogs.com/happyexp/archive/2011/08/28/2156376.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/archive/2011/08/28/2156376.html"/><content type="html">&lt;p style="text-indent: 2em"&gt;本文引用至：&lt;a href="http://hurt0759.blog.163.com/blog/static/6150904201008105614457/"&gt;http://hurt0759.blog.163.com/blog/static/6150904201008105614457/&lt;/a&gt;&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;.Net 2.0中的DataGridView比前期版本的DataGrid功能强多了，但本人还是觉得有不足的地方。比如说其DataGridViewButtonColumn列，像这样的列好像在本人开发过的系统中没有太多的用(最重要的还是不能在其上编辑，可能是没找到方法吧，再研究)。还有DataGridViewComboBoxColumn列，看起来比较漂亮，将其放在实际中，其实下拉的基本是列表或弹出一Form进行选择，但还是有问题。得到的结果要是DataGridViewComboxColumn列中的值，如果不是就会报错。还不可编辑(可能是没找到方法，再研究，找到了再继续发贴)。与以前VB6/VC6等中第三方组件开发商ComponentOne公司开发的True DB Grid还是要差点。&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;下面主要介绍研究成果：.Net 2.0中的键盘事件。&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;.Net 2.0中的键盘事件，研究了好久，只发现这两种&amp;nbsp;：一种是DataGridView键盘事件，另一种是列键盘事件。&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;第一种、DataGridView中键盘事件处理方法。此方法的使用与一般控件的方法相同。操作也比较简单。这种在DataGirdView中的事件用来操作比如删除一列啦，添加一列啦，还有插入一列啦什么的。键盘事件基本就三个：KeyDown,KeyPress,KeyUp三个事件，这里我只介绍一个，其他的都是相同的。简单介绍如下：&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;注：以下示例语句的DataGridView名为dgvDetails.&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;委托方法：&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;this.dgvDetails.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.dgvDetails_KeyPress);&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;方法：&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;private void dgvDetails_KeyPress(object sender, KeyPressEventArgs e)&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;{&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;//想怎么操作在这时处理&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;}　&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;第二种、就是DataGridView中列的事件，这种事件放在DataGridView中，开始本人用KeyPress来控件输入的数据为数字，其他的输入不进去。怎么搞都不行。不好意思，本人系统没有Help。因软件是网友送的，没送Help。摸了好久，才发现有这么个方法来实现。列的事件主要用来操作列中的数据。比如说：电话号码，数量，金额啊什么的。和大家分享研究成果。&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;首先，要先定义一个Class级的变量(放在Form内，可别放在外面)，&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;private DataGridViewTextBoxEditingControl EditingControl;&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;其次，添加EditingControlShowing事件委托&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;this.dgvDetails.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.dgvDetails_EditingControlShowing);&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;第三步，定义委托的方法：&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;private void dgvDetails_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;{&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;EditingControl = (DataGridViewTextBoxEditingControl)e.Control;&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;EditingControl.KeyPress += new KeyPressEventHandler(EditingControl_KeyPress);&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;}&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;注：加粗的地方很重要，主要是针对列的事件，这里才是正题。&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;第四步，定义列的委托方法啦，引用以其他控件引用完全相同。&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;private void EditingControl_KeyPress(object sender, KeyPressEventArgs e)&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;{&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;if (!char.IsDigit(e.KeyChar) ) e.Handled = true;&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;}&lt;/p&gt;&#xD;
&lt;p style="text-indent: 2em"&gt;哈哈，本人一试，可以了，搞定，睡觉！Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId&lt;/p&gt;&lt;img src="http://www.cnblogs.com/happyexp/aggbug/2156376.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/happyexp/archive/2011/08/28/2156376.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/happyexp/archive/2009/10/18/1585673.html</id><title type="text">[转]C#多线程同步</title><summary type="text">本文引用地址：http://blog.csdn.net/vincent0203/archive/2007/03/26/1541543.aspx在编写多线程程序时无可避免会遇到线程的同步问题。什么是线程的同步呢？ 举个例子：如果在一个公司里面有一个变量记录某人T的工资count=100，有两个主管A和B（即工作线程）在早一些时候拿了这个变量的值回去，过了一段时间A主管将T的工资加了5块，并存回cou...</summary><published>2009-10-18T15:21:00Z</published><updated>2009-10-18T15:21:00Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><link rel="alternate" href="http://www.cnblogs.com/happyexp/archive/2009/10/18/1585673.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/archive/2009/10/18/1585673.html"/></entry><entry><id>http://www.cnblogs.com/happyexp/archive/2009/05/24/1488220.html</id><title type="text">在ubuntu中构建.net开发环境(一)</title><summary type="text">安装mono2.4部分引用地址：http://www.cnblogs.com/mangix/archive/2009/04/14/1435751.html一、安装mono2.4： 1.首先到http://ftp.novell.com/pub/mono/sources-stable/ 下载mono-2.4.tar.bz2。下到我电脑的是一个乱码文件，重命名为mono-2.4.tar.bz2即可，然后...</summary><published>2009-05-24T05:14:00Z</published><updated>2009-05-24T05:14:00Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><link rel="alternate" href="http://www.cnblogs.com/happyexp/archive/2009/05/24/1488220.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/archive/2009/05/24/1488220.html"/></entry><entry><id>http://www.cnblogs.com/happyexp/archive/2009/05/24/1488120.html</id><title type="text">从源代码编译安装 Mono 2.4 和 MonoDevelop 2.0</title><summary type="text">引用地址：http://www.cnblogs.com/beginor/archive/2009/05/09/1453287.html虽然现在几乎所有的Linux发行版都预置了Mono软件，但是大多数都比较旧，因此要体验最新版本的Mono，还是要用源代码自己进行编译安装的。先说几句废话，Mono 2.4 提供了.Net 3.5 的大部分功能 (Linq、扩展方法)，提供了完整的ASP.NET支持，...</summary><published>2009-05-24T01:54:00Z</published><updated>2009-05-24T01:54:00Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><link rel="alternate" href="http://www.cnblogs.com/happyexp/archive/2009/05/24/1488120.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/archive/2009/05/24/1488120.html"/></entry><entry><id>http://www.cnblogs.com/happyexp/archive/2008/10/12/1308995.html</id><title type="text">vs2008在vista下无法调试的解决方法</title><summary type="text">本文引用至：http://www.cnblogs.com/aprillee/archive/2008/08/23/1274874.html解决步骤： 开始－运行（win+R），在此键入：c:\windows\system32\drivers\etc\hosts 然后：选择记事本或其实字本编辑器打开。打开后你会发现有这么两行代码;127.0.0.1 localhost ::1localhost 将第...</summary><published>2008-10-12T03:34:00Z</published><updated>2008-10-12T03:34:00Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><link rel="alternate" href="http://www.cnblogs.com/happyexp/archive/2008/10/12/1308995.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/archive/2008/10/12/1308995.html"/></entry><entry><id>http://www.cnblogs.com/happyexp/archive/2008/03/25/1121263.html</id><title type="text">JBoss做成FEDORA系统服务</title><summary type="text">本文引用至：http://xudayu.blog.51cto.com/187984/65254使用Linux系统的V脚本。尽管, 在分类之间有一些不同，通常它类似这样:  /etc/rc.d/init.d/ - 包含开始 和 停止 脚本 (其他分类: /etc/init.d/)  /etc/rc.(x)/ - 包含用S或者K前缀的开始和停止脚本链接(启动或者杀死) 对于各种不同层次的系统用户有各种...</summary><published>2008-03-25T06:21:00Z</published><updated>2008-03-25T06:21:00Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><link rel="alternate" href="http://www.cnblogs.com/happyexp/archive/2008/03/25/1121263.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/archive/2008/03/25/1121263.html"/></entry><entry><id>http://www.cnblogs.com/happyexp/archive/2008/02/28/1085031.html</id><title type="text">关于Flex-Mvc的几个框架的简单介绍</title><summary type="text">目前，FLEX有好几个框架，官方和非官方的，其介绍详见http://www.infoq.com/news/2008/01/flex-mvc从网上又收集了一些简单的评论，我还没有用过，打算最近对比后找一个来用用。 1、cairngorm：Cairngorm 开发的项目很难有可重用的东西，要写的类太多，view 部分也比较混乱，而且基本不可测试......不过优点是易学，易理解，官方血统（虽说是官方出...</summary><published>2008-02-28T07:41:00Z</published><updated>2008-02-28T07:41:00Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><link rel="alternate" href="http://www.cnblogs.com/happyexp/archive/2008/02/28/1085031.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/archive/2008/02/28/1085031.html"/></entry><entry><id>http://www.cnblogs.com/happyexp/archive/2007/12/03/981046.html</id><title type="text">ORALCE-ORACLE字符集的修改</title><summary type="text">该文引用至：http://www.readygo.com.cn/ORACLE/070416/2007102653095.htm 国内外大中型数据库管理系统中，把oracle作为数据库管理平台的用户比较多。oracle不论是数据库管理能力还是安全性都是无可非议的，但是，它在汉字信息的显示方面着实给中国用户带来不少麻烦，笔者多年从事oracle数据库管理，经常收到周围用户和外地用户反映有关oracle...</summary><published>2007-12-03T06:29:00Z</published><updated>2007-12-03T06:29:00Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><link rel="alternate" href="http://www.cnblogs.com/happyexp/archive/2007/12/03/981046.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/archive/2007/12/03/981046.html"/></entry><entry><id>http://www.cnblogs.com/happyexp/archive/2007/09/26/906016.html</id><title type="text">使用flex Builder3配置与开发AS3项目详解</title><summary type="text">该文引用至：http://blog.chinaunix.net/u/19228/showart.php?id=371787序： 前两天从adobe下载了flex builder3，试用了一周，感觉还是挺好的，网上都流传FDT是最好的Flash AS IDE，我也试用过fdt3 ,但是我感觉flex builder3更为优秀，其中包括代码自动完成，语法检查。。。。并且包含flex项目开发全部功能，包...</summary><published>2007-09-25T20:04:00Z</published><updated>2007-09-25T20:04:00Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><link rel="alternate" href="http://www.cnblogs.com/happyexp/archive/2007/09/26/906016.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/archive/2007/09/26/906016.html"/></entry><entry><id>http://www.cnblogs.com/happyexp/archive/2007/09/26/906015.html</id><title type="text">Adobe Flex最佳学习路线</title><summary type="text">该文引用至：http://blog.csdn.net/mozilla/archive/2007/08/23/1756761.aspx目前Adobe Flex的中文版学习资料比较少，而且大多都很零散，不适合用来系统地学习。我在这里罗列一下在我的学习过程中读过的一些资料。当然是以Adobe的官方文档为主，这些文档内容非常详尽，应该作为学习的首选。首先下载并安装好Flex开发工具Flex Builder...</summary><published>2007-09-25T20:02:00Z</published><updated>2007-09-25T20:02:00Z</updated><author><name>逍遥散人</name><uri>http://www.cnblogs.com/happyexp/</uri></author><link rel="alternate" href="http://www.cnblogs.com/happyexp/archive/2007/09/26/906015.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/happyexp/archive/2007/09/26/906015.html"/></entry></feed>
