繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> Asp.Net开发 >> text的跳转并验证

text的跳转并验证

2007-07-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:using System.Text .RegularExpressions; private void txtChequeCode_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if(e.KeyCode == Keys.Enter ) { if(Regex.Match (this.txtChequeCode .T...
关键字:验证 text

using System.Text .RegularExpressions;

private void txtChequeCode_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)

{

if(e.KeyCode == Keys.Enter )

{

if(Regex.Match (this.txtChequeCode .Text .Trim (),@"^\d+$").Success )

{

this.txtChequeSum .Focus ();

this.txtChequeSum .Select ();

}

else

{

MessageBox.Show ("输入无效!,只允许输入数字");

}

}

}

private void txtChequeSum_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)

{

if(e.KeyCode == Keys.Enter )

{

if(Regex.Match (this.txtChequeSum .Text .Trim (),@"^\d+$").Success )

{

this.ButtonSave .Focus ();

this.ButtonSave .Select ();

}

else

{

MessageBox.Show ("输入无效!,只允许输入数字");

}

}

}

责任编辑:admin
相关文章