TAdvMemo modfified problem

When i place a TAdvMemo on a form I want to do some action if the text is modified.
I do this by using this code :

procedure TMainForm.AdvMemo1StatusChange(Sender: TObject);
   if AdvMemo1.Modified then
      AdvLabel1.Caption := 'Modified';

It works for all characters but the first typed in the memo.
The problem shows up in a fresh project with only 3 TMS components on the form so it should be reproducable.

Gerhard Sachs

Do you use the latest version of the components?

I have retested this here and I can see here that OnChange is triggered also for the first character entered and that in this OnChange event handler, AdvMemo.Modified = true
The version is running on Delphi 10.3.3.
I did not use the OnChange but the OnStatusChange event.
The OnChange sets the modified flag on the first character, the OnStatusChange sets it on the second character.
Actually I was looking for an event that fires only on real code changes, not on cursor position changes.
So I tried different events and finally used obviously the wrong one.

Thank you
Gerhard Sachs

OnStatusChange is designed to trigger when things like the cursor position, insert state, ... change (to typically update a statusbar under the memo). The OnStatusChange after entering a key is triggered because this also changes the cursor position but it is triggered before Modified is set.
If you are after Modified, OnChange is the event to use.