void __fastcall TCustomDialog::StartGroup(const UnicodeString & Caption)
{
  if (FGroupBox != NULL)
  {
    FIndent = FGroupBox->Left;
    FPos = FGroupBox->Top + FGroupBox->Height + FControlPadding;
    FPrePos = FPos;
    FGroupBox = NULL;
  }

  TGroupBox * GroupBox = new TGroupBox(this);
  GroupBox->Parent = this;
  GroupBox->Caption = Caption;

  GroupBox->Left = FIndent;
  GroupBox->Top = FPos;
  GroupBox->Height = ScaleByTextHeight(GroupBox, 20);
  GroupBox->Width = GetMaxControlWidth(GroupBox);

  AdjustHeight(GroupBox);

  AddWinControl(GroupBox);

  FPos = ScaleByTextHeight(this, 16);
  FPrePos = FPos;
  FIndent = FHorizontalMargin;

  FGroupBox = GroupBox;
}

void __fastcall TCustomDialog::StartGroup(const UnicodeString & Caption)
{
  if (FGroupBox != NULL)
  {
    FIndent = FGroupBox->Left;
    FPos = FGroupBox->Top + FGroupBox->Height + FControlPadding;
    FPrePos = FPos;
    FGroupBox = NULL;
  }

  TGroupBox * GroupBox = new TGroupBox(this);
  GroupBox->Parent = this;
  GroupBox->Caption = Caption;

  GroupBox->Left = FIndent;
  GroupBox->Top = FPos;
  GroupBox->Height = ScaleByTextHeight(GroupBox, 20);
  GroupBox->Width = GetMaxControlWidth(GroupBox);

  AdjustHeight(GroupBox);

  AddWinControl(GroupBox);

  FPos = ScaleByTextHeight(this, 16);
  FPrePos = FPos;
  FIndent = FHorizontalMargin;

  FGroupBox = GroupBox;
}
