Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preferred way to keep control centered on resize

Tags:

delphi

vcl

What is your preferred way of keeping controls centered on its parent when the parent change width or height?

like image 889
Vegar Avatar asked Nov 24 '08 09:11

Vegar


2 Answers

If by 'centered' you mean "it was already in the middle and you want to keep it there without resizing it", then remove all anchors. If it should be resized, gabr's solution is the one to with :)

like image 144
Vincent Van Den Berghe Avatar answered Nov 15 '22 03:11

Vincent Van Den Berghe


Set control's Anchors property to [akLeft, akTop, akRight, akBottom].

like image 38
gabr Avatar answered Nov 15 '22 02:11

gabr