TForm1=class(TForm)
则
TForm2=class(TForm1)
则
TForm2=class(TForm1)
解决方案 »
- com+开发时,向客户断发送错误信息有何好方法?
- 菜单图标问题
- 如何删除一条纪录?
- 急需CAB格式流/内存块操作函数!!!!!!!!!!!!!!!!!!
- 怎样把一幅图片的中央一点和与这个点相邻并且颜色也相同的点的颜色都替换成自定颜色.有点像windows画板里的颜料桶功能.(算法也行)
- 关于数据库的连接关闭
- reportbuilder 控件问题。
- 使用rave能不能做出自定义报表的功能出来?
- 一个关于Tdatabase的params属性设置
- D6下demo目录中有server和clint的程序如何调用测试?我用的不知所措,报很多错。
- 怎样遍历一个目录里的所有文件并取得文件名?
- 直接控制针打的指令
file->new->other->projectname->
点你的form如果继承就用inherit
打开file->new->other->projectname->
点你要继承的form或新建一个FORM,将其改为type
TForm2 = class(TForm1)
File->New->Other->MyProject->
选择要继承的Form1,同时选中下面的Inherit旁边的RadioButton
点你的form1
同时选中下面的Inherit旁边的RadioButton1 inherit 生成的form2继承form1,form1是form2的父类
2 use 生成的form2应用form1,当修改form2的属性时form1也会改变
3copy 我记得不太清楚了问问别人吧
Inherit from the item.
Use the item directly.Copying ItemsWhen you copy an item, you make an exact duplicate of the item and add it to your project if it is a form or data module. Any changes to the item in the Object Repository will not be reflected in your copy. Alterations you make to your copy will not affect the original Repository item. Note: Copying is the only option available for using project templates or project wizards. Using a wizard does not add shared code; it runs a process that generates its own code.Inheriting ItemsInheriting items is the most flexible and powerful way to use a Repository object. Inheriting lets you reuse items within the same project.When you inherit an item, a new class is derived from the item and is added to your project. When you recompile your project, any changes made to the item in the Object Repository are reflected in your derived class, unless you have changed a particular aspect. Changes made to your derived class do not affect the shared item in the Object Repository.Note: You can inherit forms, dialog boxes, and data modules but not project templates. This is the only option available for reusing items from within the same project.Using Items DirectlyYou use the Using Items Directly option primarily with data modules. When you use an item directly, the item is added to your project as if you had created it as part of the project. Design-time changes made to the item appear in all projects that directly use the item as well as any projects that inherit from the item. Note: Using Items Directly is an option for forms, dialog boxes, and data modules. Modify these items only at runtime to avoid making changes that affect other modules.
type
TFrm2 = class(TFrm)//TFrm为你的父类窗体2、打开form2的窗体文件.dfm修改:Object 为inherited再把
Color = 14215660
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = '宋体'
Font.Style = []
这样有继承类型的语句删掉
------------------------------------------------
注意一点:若子窗体和父窗体有重名控件,你最好提前更名!祝你好运!