Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

installing components

Status
Not open for further replies.

rapha43

Programmer
Aug 22, 2003
1
BR
Please, someone help me!

The installation of the component worked fine.

When I try to insert the component into a form, a receive the following message:

"Control 'control name' has not parent window"

Someone knows the reason for such a message?

Thanks in advance,

rapha43
 
You need to assign a value to the component's Parent property. I think this has to be done at run-time (but look in the property editor at design-time first) so in your form create event put something like this:
Code:
  SomeComponent.Parent := Self;
Where SomeComponent is the name of the component you have added to the form and Self is the Form which you added the component to.

If the above code is put in Form1's create event (as suggested) then it would be surrounded by the following structure:
Code:
constructor Form1.Create(AOwner: TComponent);
begin

end;
Self refers to the object whose method we are in so in this case we are in Form1's Create method so Form1 is what the Self variable refers to.

Hope this helps!

Clive [infinity]
Ex nihilo, nihil fit (Out of nothing, nothing comes)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top