Solved

RichTextBox caret position

Posted on 2004-08-28
1
1,048 Views
Last Modified: 2010-05-18
hi

how do i find out what the current position of the caret is in a rich text box? i didn't see any methods. do i have to keep track of how many characters have been entered. seems like a pain in the butt.

thanks p
0
Comment
Question by:pipe
[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
 
LVL 3

Accepted Solution

by:
GrumbleBot earned 100 total points
ID: 11923858
You can use

int n = RichTextBox.SelectionStart

If no text is selected it will return the location within the entire text. It won't return an X,Y type position. If text is selected then it will return the position of the first selected character.

Hope this helps.

Good luck
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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