Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select words 1

Status
Not open for further replies.

bogboy1978

Technical User
Nov 8, 2002
27
GB
How do I select lines in a richedit control one at a time. I want to select the first line, do some processing on/with it and then de-select the line and select the next one, and so on till the last line is done.

If this is possible please let me know how, and if this is something that should be blindingly obvious, i appologise.

Thanks,

Joe.
 
The lines in a richedit control can be accessed through the lines property. Thus if your richedit control is called Red and you wish to change the first occurence of 'Sunday' to 'Monday' you could do:
Code:
  Red.lines[0] := StringReplace ( Red.lines[0], 'Sunday', 'Monday', [] );
Note that there may be some funny control characters in the line to set attributes such as color, size, style and so on. This may or may not be a problem for you depending on what processing you intend to carry out.


Andrew

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top