i have a little tiny problem, what i am trying to do is limit my textBox to the following characters: [a=>f, x, A=>F, 0=>9], and what i need exactly is add an exception that will make any lower case input in the mentioned textBox become uppercase, except for "x", this is what i tried, but it limited all inputs from the textBox:
if (!Char.IsDigit(e.KeyChar) && !Char.IsControl(e.KeyChar) && (e.KeyChar < 'A' || e.KeyChar > 'F') && (e.KeyChar < 'a' || e.KeyChar > 'f') && (e.KeyChar != ' '))
{
e.Handled = true;
textBox1.CharacterCasing = CharacterCasing.Upper;
}
else if ((e.KeyChar != 'x'))
{
e.Handled = true;
textBox1.CharacterCasing = CharacterCasing.Lower;
}
Thank you.