diff --git a/outlook-bulk-sender/BulkArchiveMailer.AddIn/UI/SettingsForm.Designer.cs b/outlook-bulk-sender/BulkArchiveMailer.AddIn/UI/SettingsForm.Designer.cs index 2594133..2919d63 100644 --- a/outlook-bulk-sender/BulkArchiveMailer.AddIn/UI/SettingsForm.Designer.cs +++ b/outlook-bulk-sender/BulkArchiveMailer.AddIn/UI/SettingsForm.Designer.cs @@ -253,12 +253,24 @@ namespace BulkArchiveMailer.AddIn.UI this.pnlTemplateList.Size = new System.Drawing.Size(190, 467); this.pnlTemplateList.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - // Dock order matters here: pnlTemplateButtons (Dock=Top) is - // added FIRST, lstTemplates (Dock=Fill) SECOND, so the Fill - // control's layout is computed against whatever client area - // remains under the already-docked top strip. - this.pnlTemplateList.Controls.Add(this.pnlTemplateButtons); + // Dock order matters here, and it is the OPPOSITE of what looks + // intuitive: WinForms lays out docked children in the REVERSE + // of their Controls.Add() order - the LAST control added is + // docked FIRST (closest to the parent's edge), and each + // earlier-added control is then laid out against whatever + // client area is left over. So lstTemplates (Dock=Fill) must be + // added FIRST, and pnlTemplateButtons (Dock=Top) must be added + // SECOND/last, so that the Top strip is actually the one that + // gets docked last (i.e. first in effect) and carves its 35px + // band out of the top; Fill then only gets whatever remains + // below it. Adding them in the other order (as this used to be) + // makes Fill get laid out first, against the FULL panel client + // area (nothing has carved out the top strip yet), so it + // expands to cover the entire panel and visually overlaps + // pnlTemplateButtons - exactly the "buttons overlap the list" + // bug reported on the real machine. this.pnlTemplateList.Controls.Add(this.lstTemplates); + this.pnlTemplateList.Controls.Add(this.pnlTemplateButtons); // pnlTemplateButtons //