I have a TForm
(TVehicleEditForm) with 3 identical TFrames
(TVehicleUnitFrame) inside.
The idea was that every instance of the frame handle own events by a eventhandler
inside the frame. The problem is that the eventhandler
is not called.
I have tried to assign the eventhandler
by code inside the frame by overriding the Create method but the handler is not called in that case either.
But if I assign the eventhandler
outside the frame from the form it works fine.
Like this:
fraVehicleUnitFrame1.cmdNewOwner.OnClick := fraVehicleUnitFrame1.cmdNewOwnerClick;
fraVehicleUnitFrame2.cmdNewOwner.OnClick := fraVehicleUnitFrame2.cmdNewOwnerClick;
fraVehicleUnitFrame3.cmdNewOwner.OnClick := fraVehicleUnitFrame3.cmdNewOwnerClick;
And this is only for one button! As I have many components inside the frame this would result in many assignments... Quite ugly code when this should be done directly in the object inspector.
I am using D2007. Any idea of the cause ?
Regards Roland