How to move the caret in CRichEditViewed application?
-
Hi, all, I'm programming a text editor with spell check using MFC's CRichEditView class. Anybody knows how to move the caret? My usage is that when the user types a word that is found spelled wrong, the editor has to move its caret to the word's beginning position and replace the word. I'm new to Windows programming. I have no idea how to move the caret and replace the word. I tried typing SetCaretPos( ) and ShowCaret( ) in the CMainFrame derived from CFrameWnd, but it didn't actually move the caret. The caret seemed to change its postion to the one I set in SetCaretPos( ), but when I used GetRichEditCtrl( ).Paste to paste a text for a test, the text was pasted at the position as if I didn't do the SetCaretPos( ). Peace, no war
-
Hi, all, I'm programming a text editor with spell check using MFC's CRichEditView class. Anybody knows how to move the caret? My usage is that when the user types a word that is found spelled wrong, the editor has to move its caret to the word's beginning position and replace the word. I'm new to Windows programming. I have no idea how to move the caret and replace the word. I tried typing SetCaretPos( ) and ShowCaret( ) in the CMainFrame derived from CFrameWnd, but it didn't actually move the caret. The caret seemed to change its postion to the one I set in SetCaretPos( ), but when I used GetRichEditCtrl( ).Paste to paste a text for a test, the text was pasted at the position as if I didn't do the SetCaretPos( ). Peace, no war