We have a win control object which moves its clients to some other coordiantes. The problem is, when there are too many children - for example 500 controls - the code is really
I would put all the controls in a panel, and then move the panel rather than the controls. That way you perform the shift in a one single operation.
If you would rather move the controls within their container then you can use TWinControl.ScrollBy
.
For what it is worth, it is more efficient to use SetBounds
than to modify Left
and Top
in separate lines of code.
SetBounds(Left+DX, Top+DY, Width, Height);