I am trying to make a text-box which will only accept numbers, white spaces and plus sign.
Currently I have done something like this in KeyPressEvent of the textbox
if (!char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar) &&!char.IsWhiteSpace(e.KeyChar))
{
e.Handled = true;
}
I want to accept the + sign as well
Update
I did handle the !char.IsSymbol(e.KeyChar) but it will accept the = sign as well with the +
Any help!!!
Thanks