This is my collection:
procedure SetDialogGeometry(AForm: TForm; AButton: TControl; BorderWidth: Integer); begin {$IFDEF MSWINDOWS} AForm.BorderStyle := bsDialog; {$ENDIF} {$IFDEF LINUX} AForm.BorderStyle := fbsDialog; {$ENDIF} AForm.Scaled := FALSE; AForm.HorzScrollBar.Visible := FALSE; AForm.VertScrollBar.Visible := FALSE; AForm.Left := 10; AForm.Top := 10; AForm.ClientHeight := AButton.Top + 3 * AButton.Height div 2; AForm.ClientWidth := AButton.Left + AButton.Width + BorderWidth; end;