I have created a user login Dialog Box in MFC, which have two edit fields, for username & password respectively. I need to restrict/disable user from typing “space” & a few “special characters” in Login/Password Edit Box fields. Please help me with this. Thank you.
EDIT: I’m validating the Username & Password with my SQLite database. Everything is working fine. Additional requirement is to restrict user from typing spaces in the edit field.
Please explain with some simple example. Thank you.
You need to subclass(Inherit) the CEdit control of MFC and override PreTranslateMessage and handle WM_CHAR message and filter the characters there