【发布时间】:2013-10-22 06:06:21
【问题描述】:
当我使用Char.IsNumber 时,它会在form1.designer.cs 中创建一个错误。
“
textBox1_TextChanged”没有重载匹配委托“System.EventHandler”
private void textBox1_TextChanged(object sender, KeyPressEventArgs e)
{
if (char.IsNumber(e.KeyChar))
{
textBox1.Text = e.KeyChar.ToString();
}
else
{
MessageBox.Show("Char value");
}
}
///////////// Text Box ///////////////
this.textBox1.Location = new System.Drawing.Point(73, 57);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(177, 20);
this.textBox1.TabIndex = 0;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); // error occurs on this line
【问题讨论】:
标签: c# winforms events textbox