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 ("输入无效!,只允许输入数字");
}
}
}
