PDA

View Full Version : Richtext help!!


shanex252
03-29-2009, 10:13 AM
Hi guy,

How I can delete richtext of line?

strText = RichText.GetLine("RichText1", 2);
??

holtgrewe
03-31-2009, 12:44 PM
shanex252
This should work for you. It gets a little tricky because there is limited functionality for line manipulation.

-- get the text in line 2
strText = RichText.GetLine("RichText1", 2);
-- find the location of the text in the object
gotit = RichText.FindText("RichText1", strText, 1, -1, true, true)
-- set the selection for line 2 text
RichText.SetSelection("RichText1", gotit.Start, gotit.End)
-- delete the selection and the line advance (2 deletes)
RichText.Delete("RichText1");RichText.Delete("RichText1")

hth