Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to intercept control move when editing a Delphi form

Tags:

delphi

vcl

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?

like image 371
fpiette Avatar asked Nov 03 '16 10:11

fpiette


1 Answers

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.

like image 185
kobik Avatar answered Oct 08 '22 14:10

kobik