Вверх ↑
Ответов: 4621
Рейтинг: 746
#1: 2019-05-30 15:46:15 ЛС | профиль | цитата
Не надо ничего проверять.

procedure THIWin._work_doCenterPos;
var
H: THandle;
R: TRect;
begin
H := GetParent(Control.Handle);

if (H <> 0) and GetClientRect(H, R) then
begin
Control.Left := (R.Right - Control.Width) div 2;
Control.Top := (R.Bottom - Control.Height) div 2;
end
else
begin
Control.Left := (ScreenWidth - Control.Width) div 2;
Control.Top := (ScreenHeight - Control.Height) div 2;
end;
end;
карма: 26

0