Lazarus

Programming => Packages and Libraries => RichMemo => Topic started by: bigeno on December 06, 2017, 08:41:44 am

Title: Convert to plain text
Post by: bigeno on December 06, 2017, 08:41:44 am
I've problem with convert rtf to text from Richmemo.
I just try to create richmemo load rtf and get text but maybe its wrong.
Code: Pascal  [Select][+][-]
  1.  debugln('rtf source='+s);
  2.  Rich := TRichMemo.Create(nil);
  3.  try
  4.     Rich.Rtf:=s;
  5.     Result:=Rich.Text;
  6.     debugln(Result);
  7.  finally
  8.     Rich.Free;
  9.  end;
I'm getting empty variable.
How can I do this ?
Title: Re: Convert to plain text
Post by: bigeno on December 06, 2017, 09:14:04 am
Ok, nvm,  I found the problem, TRichMemo need Parent assigned.
Code: Pascal  [Select][+][-]
  1.  Rich := TRichMemo.Create(nil);
  2.  Rich.Visible:=false;
  3.  Rich.Parent:=Form;  
TinyPortal © 2005-2018