trichview.com

trichview.support




inserting text + applytextstyle ?


Return to index


Author

Message

Stef Mientki

Posted: 07/22/2003 2:55:59


hello,


for dropping URLs, I insert the title and set the tag to the URL,

like is done in the createhyperlink example.

As long as I insert texts before other insertion points,

everything works perfect.

But as soon as I insert a textstring (I forget about the URL for a

moment), after another insertion position,

the selection is made wrong.


The routine below should insert "text" and give "ex" textstyle=4.

When I leave the "applytextstyle" out, the "ex" should be highlighted

(selected). This works correct at any place.

Any idea what is wrong with the applytextstyle steatement ?


   MoveCaretTo(Point.X,Point.Y);

   richviewedit1.GetCurrentLineCol(start_itemno,start_offset);

   richviewedit1.InsertText(#13+'text'+#13,false);

   start_offset:=2;

   end_itemno:=start_itemno;

   end_offset:=start_itemno+length('text')-2;

   richviewedit1.SetSelectionBounds(

     start_itemno,start_offset,end_itemno,end_offset);

   RichViewEdit1.ApplyTextStyle(4);

   richviewedit1.Invalidate;


thanks,

Stef Mientki





Powered by ABC Amber Outlook Express Converter