Solved

Cursor in richedit

Posted on 2000-04-26
1
361 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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now