Setting TPanel CustomAlignPosition
Posted on 2002-04-25
I have a TPanel sitting in the center of a Tabsheet. When the application is maximized and the tabsheet goes max, the panel fails to stay centered within the tabsheet.
I think it has something to do with the alignment property. So I changed the setting to be 'alcustom' and tried to set the code to do this:
procedure TfrmMDIMain.CustomAlignPosition(Control: TControl; var NewLeft,
NewTop, NewWidth, NewHeight: Integer; var AlignRect: TRect;
NewLeft := 0;
NewTop := Panel3.BoundsRect.Bottom;
NewHeight := ClientHeight - Panel3.BoundsRect.Bottom;
I'm really unsure on how to do this, but there must be a method to keep the TPanel centered no matter what condition the applciation is in.