From: Mike on
Is there a way to detect when the parent of a control is about to
change? I am aware of the ParentChanged event but that happens too
late. I don't see any ParentChanging event.

Thanks,
Mike
From: Joe Cool on
On Jan 22, 10:52 am, Mike <MLM...(a)hotmail.com> wrote:
> Is there a way to detect when the parent of a control is about to
> change? I am aware of the ParentChanged event but that happens too
> late. I don't see any ParentChanging event.
>
> Thanks,
> Mike

Just what is causing the parent to change?
From: Mike on
On Jan 22, 12:03 pm, Joe Cool <joecool1...(a)live.com> wrote:
> On Jan 22, 10:52 am, Mike <MLM...(a)hotmail.com> wrote:
>
> > Is there a way to detect when the parent of a control is about to
> > change? I am aware of the ParentChanged event but that happens too
> > late. I don't see any ParentChanging event.
>
> > Thanks,
> > Mike
>
> Just what is causing the parent to change?

Any time the control is added to or removed from a control/form.
From: Herfried K. Wagner [MVP] on
Am 22.01.2010 16:52, schrieb Mike:
> Is there a way to detect when the parent of a control is about to
> change? I am aware of the ParentChanged event but that happens too
> late. I don't see any ParentChanging event.

Why exactly does it happen too late? What do you want to achieve?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
From: Mike on
On Jan 22, 1:24 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...(a)gmx.at> wrote:
> Am 22.01.2010 16:52, schrieb Mike:
>
> > Is there a way to detect when the parent of a control is about to
> > change? I am aware of the ParentChanged event but that happens too
> > late. I don't see any ParentChanging event.
>
> Why exactly does it happen too late?  What do you want to achieve?
>
> --
>   M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>   V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>

There is some clean up work that I need to do before the control is
removed. If I wait for the ParentChanged event, the parent will be
null and I get errors.