You can take a look at the same pattern used by Windows controls these have
virtual method called IsInputChar() en IsInputKey() where you evaluate the
key pressed and return either true or false. But mostly these kinds of
things are implemented using a regular expression.
Gabriel
"Joachim" <Jo*****@discussions.microsoft.comwrote in message
news:2F**********************************@microsof t.com...
I'm interested in the answer to the question I posted, but what I really
want
to do is to make sure that my text box cannot contain certain characters
like
< | * ? : \ / ". In ASP .NET there is a special control for this, called
a
validator, but I cannot find a validator like that in my toolbox. Any
suggestions?
"Joachim" wrote:
>Why does the following code
char l_ch = Convert.ToChar(
e.KeyCode);
give me the value 226 ('â') and not 60 ('<') when I press '<' ?
What am I doing wrong? I have also tried
char l_ch = Convert.ToChar(
e.KeyCode,
CultureInfo.InvariantCulture);