C#入门经典
private void textBoxSize_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8 && e.KeyChar != 13)
{
e.Handled = true;
}
else if (e.KeyChar == 13)
{
TextBox txt = (TextBox)sender;
if (txt.Text.Length > 0)
ApplyTextSize(txt.Text);
e.Handled = true;
this.richTextBoxText.Focus();
}
}
调试的时候提示:
当前上下文不存在ApplyTextSize
在网上看了好多,貌似其它人的没有我这种情况,难道是我的vs2005有问题?
麻烦各位高手赐教咯
private void textBoxSize_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8 && e.KeyChar != 13)
{
e.Handled = true;
}
else if (e.KeyChar == 13)
{
TextBox txt = (TextBox)sender;
if (txt.Text.Length > 0)
ApplyTextSize(txt.Text);
e.Handled = true;
this.richTextBoxText.Focus();
}
}
调试的时候提示:
当前上下文不存在ApplyTextSize
在网上看了好多,貌似其它人的没有我这种情况,难道是我的vs2005有问题?
麻烦各位高手赐教咯
是我自己大意了,没有看到后面还有ApplyTextSize()这个方法,自己就急着调试了