/// <summary> /// Initilizes the controls. /// </summary> private void InitilizeControls() { SuspendLayout(); m_tableLayoutPanel = new TableLayoutPanel { AutoSize = true, ColumnCount = 1, Dock = DockStyle.Top, Location = new Point(0, 0), Name = "m_tableLayoutPanel", RowCount = m_datafiles.Count, TabIndex = 0, }; m_tableLayoutPanel.ColumnStyles.Add(new ColumnStyle()); foreach (SerializableDatafile datafile in m_datafiles) { DataUpdateDownloadControl control = new DataUpdateDownloadControl(datafile) { Dock = DockStyle.Fill, Margin = new Padding(10) }; m_controls.Add(control); m_tableLayoutPanel.RowStyles.Add(new RowStyle()); m_tableLayoutPanel.Controls.Add(control, 0, m_datafiles.IndexOf(datafile)); } int height = m_tableLayoutPanel.PreferredSize.Height + ClientSize.Height; btCancel.Location = new Point(325, height - btCancel.Height - 14); Controls.Add(m_tableLayoutPanel); ClientSize = new Size(ClientSize.Width, height); ResumeLayout(false); PerformLayout(); }