Answers for "make int input numbers only c#"

C#
8

c# textboxaccept only numbers

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
    {
        e.Handled = !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar);
    }
Posted by: Guest on March-29-2021
0

C# Numbers Only

if (!Char.IsDigit(ch) && ch != 8 && ch != 46)
            {
                e.Handled = true;

            }
Posted by: Guest on May-15-2021

C# Answers by Framework

Browse Popular Code Answers by Language