Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Cursor in richedit

Posted on 2000-04-26
1
Medium Priority
?
411 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 50 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

705 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