I’m changing the parent of a frame a runtime to move the frame from one form to another. That works fine but after that my components do not receive mouse events any longer. For example, CM_MOUSEENTER and CM_MOUSELEAVE is not fired.
Frame.Parent := SecondDisplayForm;
Frame.Align := alClient;
SecondDisplayForm.Show;
I don’t understand this effect and I don’t really know what information to provide, so if you have hints please help me out here.
It works in D7 as NGLN reported, but in BDS2006 it’s reproducible. I found that it’s important to change the parent after the
cm_mouseenter, and beforecm_mouseleave, otherways ther’s no problem. The problem is in the controls.pas I think, maybe it’s a bug. Playing around a little bit I found out that if youPerformawm_mouseleavemessage before changing the parent everything is fine again.In my sample code i change the parent in an onclick event.
I think the problem is related to the FMouseControl in Controls.pas, but haven’t investigated it properly.