Answers for "restrict user to enter specific characters in textbox"

C#
0

restrict user to enter specific characters in textbox

Restict user to input specific charector

if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) //Checking if only number and delete.
            {
                e.Handled = true;
            }
            if (e.KeyChar == 46) //Allow Decimal
            {
                if (txbCashAmnt.Text.Contains(".")) // Checking if . already available
                {
                    e.Handled = true;
                }
                else
                    e.Handled = false;

            }
Posted by: Guest on July-05-2020

Code answers related to "restrict user to enter specific characters in textbox"

C# Answers by Framework

Browse Popular Code Answers by Language