/// <summary> /// Gets the margins for the top form /// </summary> /// <param name="topOffset">top offset (title height when border style is none or zero when border style is provided)</param> /// <returns>margins</returns> private Margins GetMargins(out int topOffset) { FormsContainerControlCollection forms = (FormsContainerControlCollection)FormsPanel.Controls; Margins margins = FormWrapper.GetMargins(forms.TopControl); topOffset = 0; Form topForm = forms.TopControl as Form; if (topForm != null) { if (topForm.FormBorderStyle == FormBorderStyle.None) { margins.Top = DefaultTopMargin + DefaultTitleHeight; margins.Left = DefaultLeftMargin; margins.Right = DefaultRightMargin; margins.Bottom = DefaultBottomMargin; topOffset = DefaultTitleHeight; } } return(margins); }