All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
C#中Windows通用的回车转Tab方法_[Asp.Net教程]_0

Writer: delv Article type: Programming skills(编程技巧) Time: 2014/1/6 9:06:03 Browse times: 322 Comment times: 0

C#中Windows通用的回车转Tab方法_[Asp.Net教程]_0


Head photo

Go homepage
Upload pictures
Write articles

C#中Windows通用的回车转Tab方法_[Asp.Net教程] 原来一直是为每个文本框的KeyPress增加:

if(e.KeyChar = '\r') SendKeys.Send("{TAB}");

  最近想想,其实有更简单的方法,把Form的KeyPreView设为true,然后在Form的KeyPress中增加下列代码即可:

if (e.KeyChar == '\r')
this.SelectNextControl(this.ActiveControl, true, true, true, true);

来源:网络





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.