Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm working with a richtextbox. But I have a problem:
I need highlight line at textpointer. Not highlight text.
please help me! thank so much!
Posted
Comments
Sergey Alexandrovich Kryukov 8-Mar-11 20:18pm    
Not clear. Is it selecting?
--SA

1 solution

If you're just trying to highlight a line, the basic idea is to just do the following:

1) Take the current cursor position and decrement by one till you hit a newline character ('/r' or '/n'). Increment by one. You're now at the start of the line.

2) Take the current cursor position (before step one) and increment by one till you hit a newline character. Decrement by one. You're now at the end of the line.

3) Take the two positions from step 1 and 2 and perform a highlight.

I could provide more specifics, but it depends on what exactly you're trying to do, which isn't 100% clear from your question.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900