Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Oct : Centering child window in a parent (TPanel)

www.cryer.info
Managed Newsgroup Archive

Centering child window in a parent (TPanel)

Subject:Centering child window in a parent (TPanel)
Posted by:"H. Bouty" (hbou..@gmail.com)
Date:Sun, 22 Oct 2006 03:44:32

Hi All,

A simple problem but I cannot solve it yet :(

I made an application that mimicked an MDI app. The called form will be
parented to a TPanel. Since the child form smaller in size it would always
be positioned in the top left corner of the TPanel, how to make it centered
in its parent?
I tried :
    Top := (Panel.Width - Child.Width)/2;
    Left := (Panel.Height - Child.Height)/2;
but IDE complining about extended value vs. integer.

Anybody has a solution?

TIA,

HB

Replies:

www.cryer.info
Managed Newsgroup Archive