how to validate the special characters
-
Hi all How to validate the special characters like %,&,which should not be allowed to enter in the edit control in dialog based application. I need to validate many special characters at a time.how can i validate.
-
Hi all How to validate the special characters like %,&,which should not be allowed to enter in the edit control in dialog based application. I need to validate many special characters at a time.how can i validate.
Either write a filtered edit control (i.e. a control that does not accept certain characters) or filter the string as soon as the user hits "ok" and show him an error, if you find any characters in that field. With std::strings you could use the .find-family of operations. You could, optionally, .remove any characters that you find unsuitable and then write the result back to the editbox, with a message-box for the user showing what he did wrong.
Cheers, Sebastian -- Contra vim mortem non est medicamen in hortem.
-
Hi all How to validate the special characters like %,&,which should not be allowed to enter in the edit control in dialog based application. I need to validate many special characters at a time.how can i validate.
I suggest either use a masked edit control, or handle the
ON_ENCHANGE
notification. If any 'invalid' characters are found in the edit control, disable the OK button.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb