0
In this command below only the numbers between the quotes (") and the minus (-) of the keyboard work when the user type in a Textbox. I need it to work as well when Num Lock is enabled on the keyboard... This command below does not allow this with Num Lock enabled.
private void Somente_IntCodigo(object sender, KeyEventArgs e)
{
KeyConverter key = new KeyConverter();
if (e.Key == Key.Tab) return;
if ((char.IsNumber((string)key.ConvertTo(e.Key, typeof(string)), 0) == false))
{
e.Handled = true;
}
}
Related: Help to know what is wrong
– user28595
You know the Keys of the accents, @, keys, brackets, Alt Grs, ? , ! , mathematical signs, etc?
– Felipe Cavalcante
I found...https://msdn.microsoft.com/pt-br/library/system.windows.forms.keys%28v=vs.110%29.aspx
– Felipe Cavalcante