TForm1=class(TForm)

TForm2=class(TForm1)

解决方案 »

  1.   

    如果这个窗体加在了你的程序中
    file->new->other->projectname->
    点你的form如果继承就用inherit
      

  2.   

    如果只是在同一个dpr中(假设叫Project1.dpr),可以这样:先新建一个Form,假设叫Form1,你在上面放你需要加的控件,然后选菜单New | Other...,在其中的Project1选项页里面可以看到Form1。选中它,点击OK
      

  3.   

    还可以用模板(或称之为“仓库”)。在你的Form上点右键,在弹出的菜单里选Add to Repository,就把它加到模板里面了。想用模板的话,菜单Tools | Repository,在里面找到你想要的模板
      

  4.   

    to:delphi0302(好好学习,天天向上!) 可以详细说说怎样Inherit么?或者给个具体例子更好,我额外给你100分,如何?
      

  5.   

    现在在工程的运行中,已经有Form1,我怎样把Form2继承Form1?
      

  6.   

    将Unit加入工程
    打开file->new->other->projectname->
    点你要继承的form或新建一个FORM,将其改为type
      TForm2 = class(TForm1)
      

  7.   

    用模板是不错的选择,同时也符合对象设计思想。在你的Form上点右键,在弹出的菜单里选Add to Repository,就把它加到模板里面了。想用模板的话,菜单Tools | Repository,在里面找到你想要的模板
      

  8.   

    打开你包含Form1的工程,比如工程名为MyProject,选择菜单
    File->New->Other->MyProject->
    选择要继承的Form1,同时选中下面的Inherit旁边的RadioButton
      

  9.   

    现在在工程的运行中,已经有Form1,我怎样把Form2继承Form1?file->new->other->project1->
    点你的form1
    同时选中下面的Inherit旁边的RadioButton1 inherit 生成的form2继承form1,form1是form2的父类
    2 use   生成的form2应用form1,当修改form2的属性时form1也会改变
    3copy  我记得不太清楚了问问别人吧
      

  10.   

    o include an object from the Object Repository, you can: Copy the item.
    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.
      

  11.   

    现在在工程的运行中,已经有Form1,我怎样把Form2继承Form1?1、将
    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 = []
    这样有继承类型的语句删掉
    ------------------------------------------------
    注意一点:若子窗体和父窗体有重名控件,你最好提前更名!祝你好运!