你每写一个简单的DELPHI程序都用到继承的。还用得着专门举例吗?
你的TForm1 就是继承自TForm.至于这些控件,  在帮助中谁怎么继承来的列得一清二楚,不用多话。TWinControl 它包含了个窗口句柄。。从这个控件继承下去的东西可以有窗口提供的功能,
以及消息循环等。

解决方案 »

  1.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;TMyLabel=class(TLabel)
        public
          procedure SetMyCaption();
      end;var
      Form1: TForm1;implementation{$R *.DFM}//procedure TMyLabel.procedure TForm1.Button1Click(Sender: TObject);
    var
      MyLabel:TMyLabel;
    begin
      MyLabel := tMyLabel.Create(self);
      try
        MyLabel.SetMyCaption();
        MyLabel.parent:=self;
        MyLabel.Left:=200;
        MyLabel.Top:=100;
      finally  end;end;{ TMyLabel }procedure TMyLabel.SetMyCaption;
    begin
      Caption:='这是我预先设好的。';
    end;end.
      

  2.   

    TForm1 = class(TForm)TForm1 就是从TForm 继承下来的这就是一个很好的例子