Jaga,
This keystroke does not produce a character at all - I am pretty sure the
KeyPress event either is not raised for this keystroke, or the Char property
value in the passed KeyPressedEventArgs instance does not contain a valid
value.
To summarize, you should distinguish characters and keystrokes. Not every
keystroke can produce a character, and not every Unicode character can be
produced by a keystroke given current keyboard layout and input locale
(except for tricks like Alt followed by digit keys on the numeric
("calculator-layout") keyboard pad).
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Jaga" <ja***@web.de> wrote in message
news:OQ**************@TK2MSFTNGP09.phx.gbl...
Thank you Ed.
It means all the character, which is NOT IsControl is a printable
character?
I 'd like to test it. Does anybody knows how can I convert
System.WindowsForms.Keys.Left in a char?
Thanks
Jaga
"Ed Courtenay" <re*****************************@edcourtenay.co.uk > schrieb
im Newsbeitrag news:uI**************@TK2MSFTNGP09.phx.gbl...
You could also use the Char.GetUnicodeCategory function();
public static void Main() {
char c = '\t';
Console.WriteLine("Character is printable: {0}",
Char.GetUnicodeCategory(c) != UnicodeCategory.Control);
}
"Jaga" <ja***@web.de> wrote in message
news:us**************@TK2MSFTNGP12.phx.gbl... 1.)
I am using C#. Is there any similar function to isprint in C?
2.)
If I trap the event OnKeyDown in a Control, I become a
System.Windows.Forms.KeyEventArgs.
How can I determine whether the key in the KeyEventArgs a printable
char is?
Thanks in advance
Jaga