Board index » cppbuilder » TRichEdit Lines Count not always correct

TRichEdit Lines Count not always correct

I've found that on several occasions my call to get the Line count for a
TRichEdit returns the line number I happen to be working on not that
total lines.

I've used     rtEdit->Perform(EM_GETLINECOUNT, 0, 0);
and I've used rtEdit->Lines->Count;

I can trace through the code and the number returned can be very wrong.

Anyone else having this problem?
And more importantly have you found a fix?

Claude

 

Re:TRichEdit Lines Count not always correct


hi Claude,

i had the same problem last week.
i could work around, because i have the same content
of the richedit in a StringList and there, count seems to
be ok....

i need the count to calculate my QuickReport. it was
very strange that there where less lines than expected!

christoph

Claude <claude_at_newbie_dot_...@oro.net> schrieb in im Newsbeitrag:
38618495.E0ED9...@oro.net...

Quote
> I've found that on several occasions my call to get the Line count for a
> TRichEdit returns the line number I happen to be working on not that
> total lines.

> I've used     rtEdit->Perform(EM_GETLINECOUNT, 0, 0);
> and I've used rtEdit->Lines->Count;

> I can trace through the code and the number returned can be very wrong.

> Anyone else having this problem?
> And more importantly have you found a fix?

> Claude

Re:TRichEdit Lines Count not always correct


Hi, Claude.

From the beta SDK help:

"If the word wrap feature is enabled, the number of lines can change
when the dimensions of the editing window change."

Could that be it?  If not, could you send code/text samples to
demonstrate the problem?  (Rich Edit controls are something of a hobby
of mine and I am unaware of this problem.)

robert

Quote
Claude wrote:

> I've found that on several occasions my call to get the Line count for a
> TRichEdit returns the line number I happen to be working on not that
> total lines.

> I've used     rtEdit->Perform(EM_GETLINECOUNT, 0, 0);
> and I've used rtEdit->Lines->Count;

> I can trace through the code and the number returned can be very wrong.

> Anyone else having this problem?
> And more importantly have you found a fix?

> Claude

Other Threads