日進経験

1. 通过KeyPress 事件保证TextBox输入值都为数字。

this.testBox.KeyPress+=delegate(object sender , KeyPressEventArgs e)

{  if(e.KeyChar!=8  &&  !Char.IsDigit(e.KeyChar))  e.Handled=true;}  //8对应回格

2. 跳转页面

var newPage=new FormNewPage();

newPage.Owner=this;

this.Hide();

newPage.Show();

原文地址:https://www.cnblogs.com/aeolia/p/3899510.html