textBox你能告诉我点击按钮后如何查看内容吗?在示例中,类似的原理,仅在输入值时:
private void textBoxIPm1_KeyPress(object sender, KeyPressEventArgs e)
{
char ch = e.KeyChar;
if (!char.IsNumber(ch) && ch != 8 && ch != 46 && ch != 110 && ch != '/')
{
e.Handled = true;
}
}
更新_1:
private void button1_KeyPress(object sender, KeyPressEventArgs e)
{
char ch = e.KeyChar;
if (!char.IsNumber(ch) && ch != 8 && ch != 46 && ch != 110 && ch != '/')
{
e.Handled = true;
}
}















