在Object Inspector 中发布的属性应该全是组件源代码中在Published 部分写下才对。 不过ADOTable的Connection属性没有这样也显示出来了,这个为什么? 需要详细的介绍!您们看它的源代码里(Published)没有connection 属性;
在Object Inspector 中发布的属性应该全是组件源代码中在Published 部分写下才对。 不过ADOTable的Connection属性没有这样也显示出来了,这个为什么? 需要详细的介绍!您们看它的源代码里(Published)没有connection 属性;
TADOTable = class(TCustomADODataSet) // 继承自TCustomADODataSet
...... TCustomADODataSet = class(TDataSet, IUnknown, RecordsetEventsVt)
published
property Connection: TADOConnection read GetConnection write SetConnection;
......
父类有了,继承它自然就不需要再写一遍,减少代码编写量。
面向对象三大要素: 封装、继承、多态。这就是继承。
另外另外建议你安装这个IDE助手,显示行号,语法智能提示,语法高亮等等很有帮助
http://cnpack.org/download/unstable/CnWizards_1.0.0.648_Unstable.exe
http://cnpack.org/index.php?lang=zh-cn