Link to home
Start Free TrialLog in
Avatar of emsp
emspFlag for Norway

asked on

A few questions about handling text in RichTextBox

1: I have a function that returns the position of the Carot in the RichTextBox by returning the "SelectionStart" value. This works perfect for the first line, but when I go to line 2, it accumulates the number of characters from the first like. What I would like is for it to "reset" when you go to a new line, without having to compute how many characters are before current position, and subtracting it. I fear this would make the program sluggish when having large files.

2: I would like to set a certain part of the textline in bold, and another color. For example character 0-5. This changes as the Carot moves. I have written everything except actually setting the text. How would I best go about doing that?
SOLUTION
Avatar of crazyman
crazyman
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial