Solved

RichTextBox caret position

Posted on 2004-08-28
1
1,034 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

13 Experts available now in Live!

Get 1:1 Help Now