各位大侠,Delphi可不可以从父类的父类继承。因为它的父类的那个方法有一些我不想要的东东,我想直接从父类的父类继承该方法。procedure save; override;
procedure save;
begin
  inherited Tgrandfather.save;
end;怎么个写法?

解决方案 »

  1.   

    Tgrandfather.save
    前面写父类的名称,可以一直后面加点,直到出现你想要的东西!
    我不知道这样有没有说错!
      

  2.   

    这样试试:
    type
      tt=class(tedit)
        constructor create(aowner:TComponent);override;
      end;constructor tt.create(aowner:TComponent);
    begin
      inherited ClassParent.ClassParent.create();
    end;
      

  3.   

    为什么不行啊,比如A是最基类,B是A的派生类是C的基类,你现在想把C从A继承你就直接写
    C = class(A)
    ...写你想要的方法,
    发布你想要的方法出来!
    搞定
      

  4.   

    为什么不行啊,比如A是最基类,B是A的派生类是C的基类,你现在想把C从A继承你就直接写
    C = class(A)
    ...写你想要的方法,
    发布你想要的方法出来!
    搞定
      

  5.   

    与构造器方法一样的。
    声明一个 override 或 reintroduce 方法实现时:
    procedure TXXX.MetohdXXX(...);
    begin
      inherited ClassParent.ClassParent.Method(...);
    end;
      

  6.   

    inherited ClassParent.ClassParent.Method(...);报错,不行。
      

  7.   

    SORRY,我想当然了
    这可能要从VMT中找到地址直接执行了吧