using System.Windows.Forms;
using System;

namespace Northwind
{
	/// <summary>
	/// Summary description for NumericTextBox.
	/// </summary>
	public class NumericTextBox : TextBox
	{
		public NumericTextBox(){}
	
		protected override void OnKeyPress(KeyPressEventArgs e)
		{
			switch (Convert.ToInt16(e.KeyChar))
			{
				case (short)Keys.Back:
				case (short)Keys.Enter:
				case (short)Keys.Escape:
					//Ignore these
					return;
				default:
					e.Handled = !Char.IsDigit(e.KeyChar);
					break;
			}
		}
	}
}
