How to temporarily stop a control from being paint?

后端 未结 4 2217
伪装坚强ぢ
伪装坚强ぢ 2021-02-09 01:43

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

4条回答
  •  春和景丽
    2021-02-09 02:17

    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);
    

提交回复
热议问题