Special characters should not be allowed in single line edit control

I have a single line edit control in my window. The requirement is user should not be allowed to enter special characters in that single line edit. That means only it should accept alpha numeric characters.