I am using a windows phone 7(mango) and I have made a code in order to restrict textbox input to only digits but it is not working with the wp7 I don’t know where I am going wrong and I think that there is something missing in it but I am not getting it as I am new to C#. So is there anyone who has an idea about it and can help me out with as well. Any suggestion regarding this will be highly appreciated.
protected override void OnKeypress(KeyEventArgs a)
{
base.OnKeyDown(a);
if (char.IsDigit(Convert.ToChar(a.Key)))
{
}
else
{
a.Handled = true;
}
}
Bookmarks