?
Solved

Forms Inheritance for Delphi 5... easy points?

Posted on 2003-03-26
5
Medium Priority
?
575 Views
Last Modified: 2010-04-16
A rookie question, in two parts....

1) I've designed a form which will be needed several times later so I'd like to use inheritance to be able to enrich the inherited forms. The only problem is that the layout on the inherited form doesn't appear on the delphi 5 editor window, it seems to be empty but if I run it I have the layout of the master form... How to fix that to be able to see the inheritated layout?

2) I've try to add the master form to the object repository but it don't offer me the possibility to use inheritance afterwards (the bullet is grey, I can only do a copy). Why?

Thx

MaNu
0
Comment
Question by:usa4manu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:mocarts
ID: 8210622
first check you have both files pas and dfm for your form..
next - ensure you have open project when trying to create new inherited form.

two ways to inherit a form without adding it to repository:
1a- create new form, add components you need and save.
1b- create new form, add to uses clause parent forms unit and change class declaration to be inherited from your parent form.
examp.
  type
    TForm2 = class(TForm1)
    ..
1c- edit inherited forms dfm (by pressing alt+f12 when form is visible) and change in first row object to inherited, press alt+f12 and there must be all of your parent components.

easiest:
2a- see 1a
2b- choose File | New.. find a tab named by your project name (Project1 for examp.) and choose your new form to inherit from existing form in your project.

wbr, mo.
0
 

Author Comment

by:usa4manu
ID: 8216836
I've a problem remaining with the 1c...

Could U give me an example? Thx
0
 
LVL 9

Expert Comment

by:mocarts
ID: 8216854
in design mode right click form and choose View As Text menu item, you will see something like this:

object Form2: TForm2
Caption = '..'
..
end

change 'object' to 'inherited':
inherited Form2: TForm2
..
end

press Alt+F12 or by rightclicking in editor chose View As Form. that's all - you must see your new child form :)

wbr, mo.
0
 
LVL 9

Accepted Solution

by:
mocarts earned 1200 total points
ID: 8216870
note: both forms must be added to active Project or otherwise Delphi will not find your parent form.. generally your parent form must been added to project whenever you uses inherited forms.
0
 

Author Comment

by:usa4manu
ID: 8217843
Thx! 50 more for the quick answer! CU MaNu
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question