Solved

Cursor in richedit

Posted on 2000-04-26
1
402 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 54
Windows Drag & Drop Location 2 116
repeatSeparator  java  challenge 13 59
countEvens challenge 2 117
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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