static Form Test1(bool setSize, Action<Label[], Panel> layoutContent) { // Status bar Label[] status = { new Label(), new Label(), new Label(), new Label(), new Label() }; var statusLayout = new DynamicLayout { Padding = Padding.Empty, Spacing = Size.Empty }; statusLayout.BeginHorizontal(); for (var i = 0; i < status.Length; ++i) statusLayout.Add(status[i], xscale: true); statusLayout.EndHorizontal(); // Main panel var mainPanel = new Panel(); layoutContent(status, mainPanel); // Form's content var layout = new DynamicLayout(); layout.Add(mainPanel, yscale: true); layout.Add(statusLayout); layout.Create(); var form = new Form { Content = layout }; if (setSize) form.ClientSize = new Size(800, 600); return form; }