trichview.com

trichview.support




Inserting text at the begining of each line


Return to index


Author

Message

Mike P

Posted: 06/06/2003 12:24:33


This code throws "List index out of bounds" in SetSelectionBounds:


var

  rve:TRichViewEdit;

  i:Integer;

begin

  rve.LoadRTFFromStream(myStream);

  for i:=0 to rve.ItemCount-1 do

  begin

    if rve.IsFromNewLine(i) then

    begin

      rve.SetSelectionBounds(i,rve.GetOffsBeforeItem

        (i),i,rve.GetOffsBeforeItem(i));

      rve.InsertText('>');

    end;

  end;

end;


If we call rve.Format after LoadRTFFromStream, it works without exceptions,

but colors and font sizes are lost.





Powered by ABC Amber Outlook Express Converter