9
votes

I'm developing a visual component (VCL), a specialized TPanel. I need to intercept when the user moves a control dropped on my special panel while editing the form. I need to intercept the move to adjust visual properties of other controls dropped on the same special panel.

My question is: how can in intercept/detect/react to the move of a control dropped on a TCustomPanel derived component, while the user is editing the form within the IDE?

1
You can override AlignControlskobik
Thanks @kobik that is the right solution. If you rewrite it as an answer, I'll grant you the correct answer.fpiette
I'm very curious if this approach works.RBA
Yes, overriding AlignControls works perfectly.fpiette

1 Answers

6
votes

You could override AlignControls method of the container TPanel. the AControl argument will tell you which child control was moved or inserted into the container and react accordingly. You could then adjust the position of other child controls if needed.