trichview.com

trichview.support




Emotion icons again


Return to index


Author

Message

Marcos Lommez

Posted: 05/12/2005 4:56:41


Hi Sergey...


When a user paste a text on RichViewEdit i wanna to search and replace

icons.

Im using OnPaste event but is not working


look my code:


procedure TForm1.rve1Paste(Sender: TCustomRichViewEdit; var DoDefault:

Boolean);

  procedure SearchAndInsertIcon(const Code: String; ImageIndex: Integer);

  begin

    rve1.SetSelectionBounds(0, rve1.GetOffsBeforeItem(0), 0,

rve1.GetOffsBeforeItem(0));

    while rve1.SearchText(Code, [rvseoDown]) do

      rve1.InsertBullet(ImageIndex, ImageList1);

  end;


begin

  LockWindowUpdate(rve1.Handle);

  try

    SearchAndInsertIcon(':)', 0);

    SearchAndInsertIcon(':|', 1);

    SearchAndInsertIcon(':(', 2);

  finally

    LockWindowUpdate(0);

  end;

end;





Powered by ABC Amber Outlook Express Converter