I need to check if a character is a valid Key (type) in VB.NET (I need to turn “K” into Keys.K, for example). I am currently doing this to convert it:
Keys.Parse(GetType(Keys), key, False)
However, if key is not valid it throws an exception. How can I check if key is a valid character?
Enums do not have a TryParse method, therefore, you could do something like this:
Use it like this: