摘要: 方法一: this.dataGridView1.FirstDisplayedScrollingRowIndex = this.dataGridView1.Rows.Count - 1; 方法二: dataGridView1.Focus(); SendKeys.Send("^{End}"); 阅读全文
posted @ 2013-02-21 14:52 码写人生 阅读(648) 评论(0) 推荐(1)
摘要: #region 设置快捷键 #region 1、注册API //如果函数执行成功,返回值不为0。 //如果函数执行失败,返回值为0。要得到扩展错误信息,调用GetLastError。 [DllImport("user32.dll", SetLastError = true)] public static extern bool RegisterHotKey( IntPtr hWnd, //要定义热键的窗口的句柄 int id, ... 阅读全文
posted @ 2013-02-21 11:39 码写人生 阅读(417) 评论(0) 推荐(0)
摘要: 1、在开启一个线程,在后台运行//要在后台执行的内容 void doSth() { } void test() { ThreadStart ts = new ThreadStart(() => doSth()); Thread t = new Thread(ts); t.IsBackground = true; t.Start(); }2、启用后台运行后,需通过以下代码去访问控件,此方法对基于Control类的控件均适用,其它一些特殊控件... 阅读全文
posted @ 2013-02-21 10:58 码写人生 阅读(418) 评论(0) 推荐(0)