private void InitializeComponent() { ClientSize = new System.Drawing.Size(310, 290); FormBorderStyle = FormBorderStyle.FixedDialog; StartPosition = FormStartPosition.CenterScreen; ShowInTaskbar = false; MaximizeBox = false; MinimizeBox = false; TableLayoutPanel mainTableLayoutPanel = InitFactory.Layout.Create(1, 2, 5); mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 80F)); mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 20F)); Controls.Add(mainTableLayoutPanel); m_aboutProgramPanel = new AboutProgramPanel(m_core); m_aboutProgramPanel.Location = new System.Drawing.Point(0, 0); m_aboutProgramPanel.Dock = DockStyle.Fill; mainTableLayoutPanel.Controls.Add(m_aboutProgramPanel, 0, 0); TableLayoutPanel okButtonTableLayoutPanel = InitFactory.Layout.Create(3, 1); okButtonTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); okButtonTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); okButtonTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); mainTableLayoutPanel.Controls.Add(okButtonTableLayoutPanel, 0, 1); m_okButton = new Button(); m_okButton.Click += new System.EventHandler(OnOkButtonClick); okButtonTableLayoutPanel.Controls.Add(m_okButton, 1, 0); }
private void InitializeComponent() { ClientSize = new System.Drawing.Size(310, 225); FormBorderStyle = FormBorderStyle.FixedDialog; StartPosition = FormStartPosition.CenterScreen; ShowInTaskbar = false; ControlBox = false; MaximizeBox = false; MinimizeBox = false; TableLayoutPanel mainTableLayoutPanel = InitFactory.Layout.Create(1, 2, 5); mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 90F)); mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 10F)); Controls.Add(mainTableLayoutPanel); m_aboutProgramPanel = new AboutProgramPanel(m_core); m_aboutProgramPanel.Location = new Point(0, 0); m_aboutProgramPanel.Dock = DockStyle.Fill; mainTableLayoutPanel.Controls.Add(m_aboutProgramPanel, 0, 0); m_progressBar = new ProgressBar(); m_progressBar.Location = new Point(0, 0); m_progressBar.Dock = DockStyle.Bottom; m_progressBar.Style = ProgressBarStyle.Continuous; m_progressBar.Margin = new Padding(0); mainTableLayoutPanel.Controls.Add(m_progressBar, 0, 1); m_timer = new System.Windows.Forms.Timer(); m_timer.Interval = 100; m_timer.Tick += new EventHandler(TimerCallback); m_timer.Start(); FormClosed += new FormClosedEventHandler(OnFormClosed); }