我参照帮助问档 
结果不行嘛?3x

解决方案 »

  1.   

    你可以看New Application建立起来的窗体的例子就知道了啊。
      

  2.   

    type
      TForm1 = class(TForm)
        Button1: TButton;
      private
        { Private declarations }
      public
        { Public declarations }
      end;这就是一个很简单的类的例子
      

  3.   

    写在哪都是个可以的
    单独写在一个单元中
    写在你的窗口文件的原文件中
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;
    type
      MyClass=class//自己定义的类
        params1:integer;
        params2:string;
        procedure myproc(params:string);
      end;type
      TForm1 = class(TForm)
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}{ MyClass }procedure MyClass.myproc(params: string);
    begin
      params2:=params;
    end;end.
      

  4.   

    就是啊,你可以独立开一个unit来写啊,也可以写在其它地方写啊。