delphi 中 关于类   从定义到调用,给个简单例子  谢谢了

解决方案 »

  1.   

    在Delphi中新建一个Application,生成的TForm1类从定义到调用就都有了
      

  2.   

    更多的内容可根据情况直接参考VCL源码,类的定义、实现和调用例子可谓璨若群星
      

  3.   


    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      //这个类可以放到其他单元
      TMyClass = class
        private    public
          procedure Show;
      end;  TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}{ TMyClass }procedure TMyClass.Show;
    begin
      ShowMessage('ok');
    end;procedure TForm1.Button1Click(Sender: TObject);
    var
      my:TMyClass;
    begin
      my := TMyClass.Create;
      my.Show;
    end;end.
      

  4.   

    在调用字符串操作函数时  需要uses  吗  如果需要引 你们引什么啊