Detecting CR in an Edit Box
Posted on 2004-11-12
I have an edit box that gets a decimal value from the user. I pick up the value with an UpdateData() in the routine for a pressed button in the same dialog box, and this works fine. But if the user enters carriage-return after entering the decimal input, the entire dialog box closes down and control exits my program. I thought I might be able to fix this by putting code in the EN_CHANGE routine for the edit box to look for CR, but this routine only gets called when a non-CR character is entered. CR does the same thing as before - closes down the diaglog box and exits.
So how can I determine that CR was entered into my edit box?