还有就是如何实现自定义一个新类,并实例化之。
解决方案 »
- delphi 比较日期大小的问题
- RAIZE的气泡提示RzBalloonHints怎么用?
- 急求关于写ini文件和写文本文件的问题
- SOCKET 新手
- 我是从pb刚转到delphi上的,有一个简单问题要请教各位
- 小字体环境下写的程序到大字体环境下,一塌糊涂,怎么办?
- C/S结构下怎样保存数据?
- 关于InstallShiled制作安装文件问题,如何在安装中途设置重启,在重启后又能回到下一个安装步骤?
- 新手问题:找不到html组件,在线等候!一定给分
- 我的98系统突然不能打开*.chm文件,但F1键可以激活98的帮助???为什么
- 我用shelltreeview怎样回到原来的root的状态啊?
- 各位師兄!!!!如何把查詢出來的記錄導入到execl2000當中!!!
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
不就是一个新类吗?
type
TMyBaseClass = class
private
FInt: integer;
public
procedure MyMethod; virtual; //定义虚方法,才可以在子类中覆盖
end;
然后定义个类继承它
type
TMySonClass = class(TMyBaseClass)
public
procedure MyMethod; overload; //覆盖父类的虚方法
end;
TFreight= Class(TCompany)
public
procedure FreightItemList(mm:String); overLoad;
Procedure FreightItemList(mm:String,nn:Intger);overLoad;
type
TMyBaseClass = class
private
FInt: integer;
public
procedure MyMethod; virtual; //定义虚方法,才可以在子类中覆盖
end;
然后定义个类继承它
那么如何动态地创建子类呢?象c++中就用的new。