rashidnk
1
Q:

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;

            }


0

New to Communities?

Join the community