I have a TRichEdit with some RTF in it (text with formatting only) and I want to know if all the content of the TRichEdit is selected. To do so, I do:
var AllSelectd: Boolean;
//...
AllSelectd := MyRichEdit.SelLength = MyRichEdit.GetTextLen;
which works fine, except when the content has three lines or more. With zero to two lines, everything is fine. As soon as I reach three lines in my TRichEdit, the code above no longer works (MyRichEdit.SelLength < MyRichEdit.GetTextLen
). Each line is terminated with CRLF (#13#10
).
Is this a bug? How can I reliably check if everything is selected in the TRichEdit?
I use Delphi 10.4, if it changes anything.