显示前更改 WIndow 大小的正确方法

Correct way to change WIndow Size before showing

我已经从 XE7 移动了项目,在子窗体的 OnCreate 中我改变了 window 的大小,这个窗体有 Position := MainFormCenter.

现在在 Berlin 中,我在显示此子窗体后得到了 Left = 0 和 Top = 0。如果 window 大小在 OnCreate 中没有改变,那么这个子窗体创建正确并且它在主窗体上居中。

我现在应该如何在 Delphi Berlin 的初始化期间更改表单大小而不丢失表单位置设置?

此处表格位置改为TFormPosition.Designed:

unit FMX.Forms

procedure TCommonCustomForm.Show;
var
  LPosition: TFormPosition;
...
begin
...
          // If you changed the original coordinates or size
          if TBoundChange.Location in FBoundChanges then
          begin
            if LPosition = TFormPosition.Default then
              LPosition := TFormPosition.DefaultSizeOnly
            else if LPosition in [TFormPosition.DefaultPosOnly, TFormPosition.ScreenCenter, TFormPosition.DesktopCenter,
              TFormPosition.MainFormCenter, TFormPosition.OwnerFormCenter] then
              LPosition := TFormPosition.Designed; // Changed here to Default
          end;
...
end;

更新:

我发现的一种方法 - 从表单的 OnShow 方法更改大小

没有其他答案 - 解决此问题的一种方法是在表单的 OnShow 方法中更改表单大小