Advmemo's modified variable does not get set to modified if the memo is programmatically modified.

To reproduce, put an advmemo on a form and add the following to formcreate:

  AdvMemo1.lines.Insert(0, 'test');
  if AdvMemo1.modified then
    Caption := 'modified'
    Caption := 'not ' + 'modified';

Could you fix this?

Thank you!


The Modified property is only set to true after a user interaction through mouse or keyboard. When inserting a line, the modified property is not changed, because you already know it is modified.

I would like to suggest that you update the documentation to reflect this, Although your point is technically correct, it would be a great convenience if the control tracked modifications automatically regardless of how the text was inserted or deleted.

As Pieter informed, this can be perfectly tracked if this is wanted, from application level code.