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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with a component

Status
Not open for further replies.

proguru

Programmer
Mar 31, 2001
19
0
0
PY
I try to use a component derived from TRichedit. I test it in a project and works. The next step is to install it. The install process also works (does not give any errors). When i open a new project and rty to drop the component in the form,the error appears "Control has no parent window"

I try to overrides the function CreateWnd but does not work either. Can you help me please?

Thanks.
 
In the component's constructior, are you setting the component's Parent? Look up TWinControl::parent and TWinControl::Owner in BCB help.
If you were trying to create the component at runtime, you must set it's Parent property
Code:
TRichEdit *newRichEdit = new TRichEdit(Form1);
newRichEdit->Parent = Form1;
// Set other properties
.
.
.
[pc3]
In the end it will probably be the simplest, most obvious thing that I was doing wrong...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top