Answers for "Textbox allow only numbers 1 to 100 c#"

C#
0

Textbox allow only numbers 1 to 100 c#

private void txtnum3_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsDigit(e.KeyChar) && e.KeyChar != (char)8 && e.KeyChar != (char)13)

            {

                e.Handled = true;

                errorProvider1.SetError(txtnum3, "Input must be a number");

                errorCount++;


            }

            else

            {

                errorProvider1.SetError(txtnum3, "");

            }
        }
Posted by: Guest on August-25-2021

Code answers related to "Textbox allow only numbers 1 to 100 c#"

C# Answers by Framework

Browse Popular Code Answers by Language