IComponentChangeService events NOT fired at the right times!?
I am working on a custom compact framework 2.0 custom control
(extending Panel control) + designer and appear to be having trouble
with the IComponentChangeService event notifications.
In my designer I have registered events for all of the handlers;
ComponentChanged, ComponentChanging, ComponentRemoving,
ComponentRemoved, etc. I am receiving the appropriate events but they
do not appear to be at the correct times.
e.g.
1. If I drag the standard Button control onto my control. I eventually
receive a ComponentAdded event, however if I call back into my control
the Controls property does not yet reflect the change - ERROR?. I then
will receive the ComponentChanged referring to the Controls property
at which point it is correct.
2. If I delete the Button control from my container I receive both the
ComponentRemoved and ComponentChanged (on the Controls property)
however calling back into my control I still see the Button in the
Controls property - both cases seem to be an ERROR. It obviously is
removed at some point in time but after I have already been notified.
Am I missing something here? Or should I be hooking into another
Service for other notifications?
Thanks in advanced,
Steve.
Using Visual Studio 2005 Professional Edition v 2.0.50727
Developing in C#
Date:Wed, 15 Aug 2007 13:43:07 -0700
Author:
|