Solved

Cursor in richedit

Posted on 2000-04-26
1
385 Views
Last Modified: 2013-11-20
I am devloping a Editor whose view class is inherit by CRichEditView. I want to introduce bookmarks in my editor in the same way as done in VC++ IDE. My problem is that I want to set the cursor position after same spaces in RichEidt so that I can paste bookmark bmp at that place. Please reply
0
Comment
Question by:nabnof
1 Comment
 

Accepted Solution

by:
appleby earned 25 total points
ID: 2760365
In your class derived from CRichEditView you can use this code to set your cursor position wherever you want it:

CRichEditCtrl& theCtrl = GetRichEditCtrl();
CHARRANGE crSel;

//if you need to find out the current cursor position            
theCtrl.GetSel(crSel);

//set up the charrange structure to the new location you want to move the
//cursor to.  Make the min and max positions the same to put the cursor at
//one position with nothing selected.
crSel.cpMin = crSel.cpMin + 4; //for example to move it 4 characters over
crSel.cpMax = crSel.cpMin; //want nothing selected, so same as min.
            theCtrl.SetSel(crSel); //sets the cursor to the location you
// just defined.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question