是c#不是其他
弹出是列如输入0-200,而输入200以上是就会弹出
需求要说清楚?窗体的还是Web程序?
要怎么弹出
先放个textbox控件 然后写个控件值改变的监控事件
private void textBox1_TextChanged(object sender, EventArgs e)//事件名称
{
if (this.textBox1.Text == "") return;
try
{
int Record = int.Parse(this.textBox1.Text);
if (Record >= 200)
{
MessageBox.Show("数值太大!");
this.textBox1.Text = "";
}
}
catch (Exception el) {
el.ToString();
MessageBox.Show("请输入数字");
this.textBox1.Text = "";
}
}
要怎么弹出
先放个textbox控件 然后写个控件值改变的监控事件
private void textBox1_TextChanged(object sender, EventArgs e)//事件名称
{
if (this.textBox1.Text == "") return;
try
{
int Record = int.Parse(this.textBox1.Text);
if (Record >= 200)
{
MessageBox.Show("数值太大!");
this.textBox1.Text = "";
}
}
catch (Exception el) {
el.ToString();
MessageBox.Show("请输入数字");
this.textBox1.Text = "";
}
}
温馨提示:答案为网友推荐,仅供参考