TEdit and TMemo strange behaviour (bug ?) lazarus / 8-Other ---------------------------------------------------------------------- Bart · 2006-05-05 10:08 Hi, When you plave a TMemo or a TEdit on a form at designtime,  clear the text, and then just run the program, one would not expect that the TEdit or the TMemo gets modified, would you? Take the following example: On a new from drop TEdit  - Name = 'Edit1'  - Clear the text TMemo  - Name = Memo1  - Clear the Lines TMemo  - Name = Debugger  - Clear the Lines Now Set the OnChange event of Edit1 and Memo1 to TForm1.Memo1Changed Add this codeCode: [Select]procedure TForm1.FormCreate(Sender: TObject); begin   debugger.lines.add('FormCreate');   if edit1.Modified then debugger.Lines.Add('  --> Edit1 is Modified') else debugger.Lines.Add('  --> Edit1 is NOT Modified');   if memo1.Modified then debugger.Lines.Add('  --> Memo1 is Modified') else debugger.Lines.Add('  --> Memo1 is NOT Modified'); end; procedure TForm1.FormShow(Sender: TObject); begin   debugger.lines.add('FormShow');   if edit1.Modified then debugger.Lines.Add('  --> Edit1 is Modified') else debugger.Lines.Add('  --> Edit1 is NOT Modified');   if memo1.Modified then debugger.Lines.Add('  --> Memo1 is Modified') else debugger.Lines.Add('  --> Memo1 is NOT Modified'); end; procedure TForm1.Memo1Change(Sender: TObject); begin   debugger.lines.add(Format('-- Memo1Change is fired: Sender = %s',[(Sender as TComponent).Name])) end; Run the program and watch the output in the Debugger memo: On Lazarus 0.9.12/win32 it outputs: Code: [Select]FormCreate   --> Edit1 is NOT Modified   --> Memo1 is NOT Modified -- Memo1Change is fired: Sender = Edit1 FormShow   --> Edit1 is Modified   --> Memo1 is NOT Modified On Lazarus 0.9.13/Linux (Suse 10.0) it outputs Code: [Select]FormCreate   --> Edit1 is NOT Modified   --> Memo1 is NOT Modified -- Memo1Change is fired: Sender = Memo1 -- Memo1Change is fired: Sender = Memo1 FormShow   --> Edit1 is NOT Modified   --> Memo1 is Modified The same code in Delphi (3 Pro) outputs Code: [Select]FormCreate   --> Edit1 is NOT Modified   --> Memo1 is NOT Modified FormShow   --> Edit1 is NOT Modified   --> Memo1 is NOT Modified So, somewhere between the OnCreate and OnShow of the form in win32 the Edit's OnChange is called and in Linux the Memo's OnChange is called even twice. I would expect the behaviour I see in Delphi. And even if this is by design, I would expect it to be the same in Windows and Linux. When you run an editor application of some sort and it even claims that your empty editor at startup is modified, that does not sound OK to me. Can anyone reproduce this behaviour in more recent versions. Does it behave different under win32 than under Linux, MacOS ... If anyone can confirm this, I think I should file a bugreport. Bart