|
-
July 17th, 2004, 11:13 AM
#1
Prevent \r\n in CEditView
Hello
I have a CEditView in a splitterWindow when I hit the return key the data in the windows is captured in the OnChar(...) message handler using GetWindowText(..).
My problem is when I clear the window using SetWindowText("") it leaves a \r\n which is not what I intended. Its making my head bleed, does anyone know how to rid this \r\n.
Thanks
kogg
Last edited by kogg; July 17th, 2004 at 11:48 AM.
-
July 17th, 2004, 09:20 PM
#2
You trap the Enter key, copy the text, and then clear the view, but the Enter key has allready been processed and will generate a "/r/n" when the OnKeyUp event fires (after clearing the view). Trapping the key in OnChar is too late to cancel the keystroke. You should probably trap the keystroke in PreTranslateMessage rather than in OnChar, and then you should by able to cancel the keystroke so that it does not generate the unwanted "/r/n".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|