在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
delphi继承form TFrmBase = class(TForm) procedure FormShow(Sender: TObject); end; procedure TFrmBase.FormShow(Sender: TObject); begin ShowMessage('base show'); end;
type TFrmBase14 = class(TFrmBase)procedure FormShow(Sender: TObject); private { Private declarations } public { Public declarations } end;
procedure TFrmBase14.FormShow(Sender: TObject); begin inherited; ShowMessage('child show'); end; 没有inherited;就不会调用父类的方法。
http://blog.csdn.net/foreverhuylee/article/details/37907817
class t0 { public: int a; void fun() {a++; } }; class t1 :public t0 { public: //int a; void fun() {t0::fun(); a = a * 2; } }; t1 t; t.a = 2; t.fun(); t.a = 2; 调用父类方法必须明确写上。t0::fun(); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论