A simple error has not been carefully considered.

zhaozj2021-02-16  89

Unit unit1;

Interface

Uses Windows, Messages, Sysutils, Variants, Classes, Graphics, Controls, Forms, Dialogs

TYPE TFORM1 = Class (TFORM) Procedure formcreate (sender: TOBJECT); private {private declarations} end;

Var Form1: TFORM1;

IMPLEMENTATION

{$ R * .dfm}

Procedure TFORM1.FormCreate (Sender: TOBJECT); Begin Form1.top:=100;

END;

End.

In the implementation function of the form class, Form1.top, Form1.Left, Form1.visible, etc. Among the similar usage. It is actually wrong. If this form is not automatically created, there is no such application.createform (TFORM1, FORM1) in the project file; then it is clear that the Form1 is only defined and is not initialized. Any property error error occurs when calling Form1 at this time. However, we have confused for Form1 and TForm1 many times.

转载请注明原文地址:https://www.9cbs.com/read-13539.html

New Post(0)