Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/forums/mfc/)
-   -   eyDown Event(Problem in detecting "SHIFT + 1") (http://www.go4expert.com/forums/eydown-event-detecting-shift-1-t7427/)

apremanandh 21Nov2007 10:37

eyDown Event(Problem in detecting "SHIFT + 1")
 
Hi friends,

I working with MFC and i am a beginner also,
I am Trying to validate an editbox (which take a phone number as input with starting character '+' should be allowed if user wishes).
i am not able to block special characters(!,@,#,$,%,^,&,*,(,))

Please help me to solve this problem. :confused:

shabbir 21Nov2007 17:36

Re: eyDown Event(Problem in detecting "SHIFT + 1")
 
you need to sub class the CEdit class and have your own event handler for the keypress / keydown event and then handle the characters accordingly. Also if you wish you can validate in the lost focus event there.

apremanandh 23Nov2007 12:28

Re: eyDown Event(Problem in detecting "SHIFT + 1")
 
Ok i tried out this logic and it works, but one problem, this nChar Param in OnKeyDown always showing the Capital letter Ascii only. any solution for that

shabbir 23Nov2007 17:39

Re: eyDown Event(Problem in detecting "SHIFT + 1")
 
That should not be the case unless you have caps lock on.


All times are GMT +5.5. The time now is 20:57.