Here is an example of capturing the KeyDown and KeyPress events for a textbox to limit numeric input. You could also modify this logic to accept only the characters you want: Limiting input in control...
In addition to the examples sknake gave you, you might want to read up on Validating and Validated methods: Validating entered data...