//---------------------------------------------------------------------------
如想限制文本输入框输入数字1-4并允许使用删除键可以用以下方法
如:textbox名字是TB_PsamIc
//---------------------------------------------------------------------------
private void TB_PsamIc_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
if ((e.KeyChar >= '1' && e.KeyChar <= '4') || e.KeyChar == '\b')
{
e.Handled = false;
}
}
//---------------------------------------------------------------------------