Search code examples
delphirichedit

how to make the richedit not to select or hightlight?


help i wnted the richedit cannot be highlighted/ disable the hightlight or selection of text? also remove the cursor pos. the application is intended for display only the rtf text and not editing so i dont need those features. in delphi


Solution

  • you can set the SelLength property to 0 in the OnSelectionChange event

    procedure TForm1.RichEdit1SelectionChange(Sender: TObject);
    begin
     TRichEdit(Sender).SelLength:=0;
    end;