Mega Code Archive

 
Categories / Delphi / Files
 

How to insert a file in a TMemo at the cursor position

Title: How to insert a file in a TMemo at the cursor position procedure TForm1.Button1Click(Sender: TObject); var sl: TStringList; begin sl := TStringList.Create; try sl.LoadFromFile('c:\afile.txt'); Memo1.SetSelTextBuf(PChar(sl.Text)); finally sl.Free; end; end;