using System.Windows.Forms;

namespace _11_5
{
    public partial class NumberTextBox : UserControl
    {
        public NumberTextBox()
        {
            InitializeComponent();
            //----------------------------------------------------
            this.Size = textBox1.Size;
            textBox1.Location = new System.Drawing.Point(0, 0);
        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!(char.IsDigit(e.KeyChar) || char.IsControl(e.KeyChar)))
                e.Handled = true;
        }
    }
}