Board index » delphi » Frames: Control has no Parent frame

Frames: Control has no Parent frame

I keep getting a "control has no parent window" when I try and
display a form with a frame that contains the guilty control.  I have
this frame in use in half dozen places on different forms.  It works
well, for the most part.  Every now and then however, after a couple
of edits that seem innocuous to me, this control of the frame loses
its parent setting apparently.  It feels like an IDE problem to me,
and I am wondering if anyone else has enountered this problem.

Thanks /steve

 

Re:Frames: Control has no Parent frame


Quote
"Steve Baker" <70264.NOSPAM2...@compuserve.com> wrote in message

news:VA.0000004c.00ecdef7@compuserve.com...

Quote
> I keep getting a "control has no parent window" when I try and
> display a form with a frame that contains the guilty control.
> It feels like an IDE problem to me, and I am wondering if anyone
> else has enountered this problem.

You are not alone. I gave up using frames for anything but very simple
uses because of this and anchor problems with frames.

The problem seems to occur if you have any descendants open in
the IDE while you are adding components that don't use a window
handle to the ancestor. eg. TLabel, TSpeedButton etc.
The cure is:

1/ Close all descendant frames.
2/ Add the component to the ancestor.
3/ Compile (May need to be built)
You can then reopen the desendents if you want.

I created a small test to demonstrate this last year. If you are
interested, I could send it to you.

Hope this is of some help to you.

-Mike

Re:Frames: Control has no Parent frame


Thanks Mike...  That'll at least give me a plan of attack to try and
avoid this problem.

Appreciate it.
/steve

Other Threads