Tuesday, 11 March 2014

Numeric Texbox

Allow Only Numeric Value in Texbox Using Bellow Code On Keypress Event

 private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar >= '0' && e.KeyChar <= '9') return;
            if (e.KeyChar == '+' || e.KeyChar == '-') return;
            if ((e.KeyChar == (char)Keys.Back)) return;
            e.Handled = true;
        }



No comments:

Post a Comment

AngularJs6 using with Asp.net Core Web API 2

AngularJs6 using with Asp.net Core Web API 2 Steps 1) Create project using with command 2) Create services 3) Create routing 4) Modif...