I created a small project that has these 
components and it worked fine in D7 under XP; 
which version are you using?  I note that your 
OnClick below refereces Tform1, but your 
OnDeactivate references Tform2.  Perhaps the code 
below doesn't reflect all the code in your project?

Also, since the form is change to StayOnTop, the 
OnDeactivate event never gets fired...


At 02:20 AM 5/9/2009, Cédric Joubert wrote:
>hi,
>
>I have a simple question about repainting 
>controls in a form but this example is maybe simpler to ask my question :
>
>I have a form with 1 TButton, 1 TEdit and 1 TMemo.
>
>     the text 'Edit1' is displayed in TEdit.text
>     the text 'Memo1' is displayed in the first line of TMemo
>
>In my code Button1.OnClick i have just 2 lines :
>
>procedure TForm1.Button1Click(Sender: TObject);
>begin
>   FormStyle := fsNormal;
>   FormStyle := fsStayOnTop;
>end;
>
>In my TForm.OnDeactivate i have just this line :
>
>procedure TForm2.FormDeactivate(Sender: TObject);
>begin
>   Memo1.Lines.Add('deactivate');
>end;
>
>
>Question : when i launch my form I see the 2 
>text "Edit1" and "Memo1" correctly displayed.
>Then when I click on the button, the "Edit1" 
>text stay right displayed in TEdit
>but the text of TMemo is erased, why ?
>
>TEdit and TMemo have exactly the same priciapl 
>heritance hierarchy...(TWincontrol... TPersistent...).
>
>Anyone can help me ?
>
>Cédric
>
>
>_______________________________________________
>Delphi mailing list -> Delphi@elists.org
>http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Regards,
Sid Gudes
PIA Systems Corporation
sid.gu...@piasystems.com 


_______________________________________________
Delphi mailing list -> Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to