比如TScrollingWinControl继承了TWinControl
在TScrollingWinControl的Create方法中
inherited Create(AOwner);这句就表示执行了下面的代码
-------------------------------------------------------------------
constructor TWinControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LINUX}
FObjectInstance := WinUtils.MakeObjectInstance(MainWndProc);
{$ENDIF}
{$IFDEF MSWINDOWS}
FObjectInstance := Classes.MakeObjectInstance(MainWndProc);
{$ENDIF}
FBrush := TBrush.Create;
FBrush.Color := FColor;
FParentCtl3D := True;
FTabOrder := -1;
FImeMode := imDontCare;
if SysLocale.PriLangID = LANG_JAPANESE then
FImeName := ''
else
FImeName := Screen.DefaultIme;
FUseDockManager := False;
FBevelEdges := [beLeft, beTop, beRight, beBottom];
FBevelInner := bvRaised;
FBevelOuter := bvLowered;
FBevelWidth := 1;
FHelpType := htContext;
end;
------------------------------------------------------------------
执行完它之后才是它自己本身的Create方法执行.
constructor TScrollingWinControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);//执行 TWinControl.Create
ControlStyle := ControlStyle + [csNeedsBorderPaint];
FHorzScrollBar := TControlScrollBar.Create(Self, sbHorizontal);
FVertScrollBar := TControlScrollBar.Create(Self, sbVertical);
FAutoScroll := True;
end;