AdvMemo, Modifed, and Return Key

Good morning to all,

in AdvMemo if the first key down is RETURN (or enter) the property Modified does not change and still remain False.

Even if the key is pressed for severals times (meaning severals lines added) Modified still remain to False.

This append in all cursor position (begin,end or middle text position).

Thank's for the attention



Hi to all again,

if the first key down is one of the cursor key (so the text is not modified) the Modified change into True.

This is not so correct, if i only read the text i do change it !!

This do not happend if the text is scrolled with mouse whell or if scroll bar is used (correctly)



I cannot see such issue.
When I drop a TAdvMemo on the form and button with the code:

procedure TForm1.Button1Click(Sender: TObject);
  if AdvMemo1.Modified then

starting the app, pressing return in the memo and then clicking the button, it shows that the memo was modified, which is what is expected.

Hi Bruno,

now i check the modified status in onchange event, the rigth place (before i checked the status in the onkeyup event).

Now all works well.

The last thing that's remain "open" is why if i move the cursor with the arrows key, without changing the text, the modified status change into True.

Have nice day


I cannot reproduce this.

This event
procedure TForm1.AdvMemo1Change(Sender: TObject);
  if advmemo1.Modified then
    outputdebugstring('not modified');

is not triggered here when I just use the arrow keys to move the cursor in the TAdvMemo.

How exactly can this be reproduced starting from a default TAdvMemo (latest version) on the form?