/// <summary> /// Copies the last row of a This and all controls in it. /// </summary> /// <param name="This">This TableLayoutPanel.</param> /// <param name="controlCallback">The control callback if any, passing targetRow,targetColumn,sourceControl,targetControl.</param> /// <param name="allowSuspendingLayout">if set to <c>true</c> allows suspending the This layout during this process to prevent flickering.</param> public static void CopyLastRow(this TableLayoutPanel This, Action <int, int, Control, Control> controlCallback = null, bool allowSuspendingLayout = true) { #if NET35 Debug.Assert(This != null); #else Contract.Requires(This != null); #endif if (allowSuspendingLayout) { This.SuspendLayout(); } var lastRow = This.RowCount - 1; // add line This.RowCount++; // add style var rowStyle = This.RowStyles[lastRow]; This.RowStyles.Add(new RowStyle(rowStyle.SizeType, rowStyle.Height)); // copy controls var alreadyVisitedControls = new Dictionary <Control, bool>(); for (var i = This.ColumnCount; i > 0;) { --i; var control = This.GetControlFromPositionFixed(i, lastRow); if (control == null || !alreadyVisitedControls.TryAdd(control, true)) { continue; } var newControl = control.Duplicate(); if (controlCallback != null) { controlCallback(lastRow + 1, i, control, newControl); } This.Controls.Add(newControl, i, lastRow + 1); This.SetRowSpan(newControl, This.GetRowSpan(control)); This.SetColumnSpan(newControl, This.GetColumnSpan(control)); } if (allowSuspendingLayout) { This.ResumeLayout(true); } }
public ListBoxForm() { OKbtn.DialogResult = System.Windows.Forms.DialogResult.OK; OKbtn.Text = "ok"; SelAllbtn.Text = "Select All"; SelAllbtn.Click += selall_click; lb.Dock = System.Windows.Forms.DockStyle.Fill; lb.Width = 230; tblp.ColumnCount = 2; tblp.RowCount = 2; tblp.Controls.Add(lb); tblp.SetRowSpan(lb, 2); tblp.Controls.Add(OKbtn); tblp.Controls.Add(SelAllbtn); tblp.Dock = System.Windows.Forms.DockStyle.Fill; Controls.Add(tblp); }
public ListBoxFilterForm() { OKbtn.DialogResult = System.Windows.Forms.DialogResult.OK; OKbtn.Text = "ok"; SelAllbtn.Text = "Select All"; SelAllbtn.Click += selall_click; filterTB.TextChanged += new EventHandler(filterTB_TextChanged); lb.Dock = System.Windows.Forms.DockStyle.Fill; lb.Width = 230; tblp.ColumnCount = 2; tblp.RowCount = 3; tblp.Controls.Add(lb); tblp.SetRowSpan(lb, 3); tblp.Controls.Add(OKbtn); tblp.Controls.Add(SelAllbtn); tblp.Controls.Add(filterTB); tblp.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 80F)); tblp.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F)); tblp.Dock = System.Windows.Forms.DockStyle.Fill; Controls.Add(tblp); }
private void InitializeComponent() { ComponentResourceManager manager = new ComponentResourceManager(typeof(AboutDialog)); this.lblLicense = new LinkLabel(); this.lblNomad = new Label(); this.lblVersion = new Label(); this.lblCopyright = new Label(); this.btnClose = new System.Windows.Forms.Button(); this.lblHomePage = new LinkLabel(); this.lblEMail = new LinkLabel(); this.btnCheckForUpdates = new System.Windows.Forms.Button(); this.lblTarget = new Label(); this.tlpLicense = new TableLayoutPanel(); this.imgLicense = new PictureBox(); this.bvlButtons = new Bevel(); PictureBox box = new PictureBox(); TableLayoutPanel panel = new TableLayoutPanel(); TableLayoutPanel panel2 = new TableLayoutPanel(); ((ISupportInitialize) box).BeginInit(); panel.SuspendLayout(); this.tlpLicense.SuspendLayout(); ((ISupportInitialize) this.imgLicense).BeginInit(); panel2.SuspendLayout(); base.SuspendLayout(); box.Image = Resources.NomadAboutLogo; manager.ApplyResources(box, "imgNomad"); box.Name = "imgNomad"; panel.SetRowSpan(box, 6); box.TabStop = false; manager.ApplyResources(this.lblLicense, "lblLicense"); this.lblLicense.Name = "lblLicense"; this.lblLicense.TabStop = true; this.lblLicense.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lblLicense_LinkClicked); manager.ApplyResources(this.lblNomad, "lblNomad"); this.lblNomad.Name = "lblNomad"; manager.ApplyResources(this.lblVersion, "lblVersion"); panel.SetColumnSpan(this.lblVersion, 2); this.lblVersion.Name = "lblVersion"; manager.ApplyResources(this.lblCopyright, "lblCopyright"); panel.SetColumnSpan(this.lblCopyright, 2); this.lblCopyright.Name = "lblCopyright"; manager.ApplyResources(this.btnClose, "btnClose"); this.btnClose.DialogResult = DialogResult.Cancel; this.btnClose.Name = "btnClose"; this.btnClose.UseVisualStyleBackColor = true; manager.ApplyResources(this.lblHomePage, "lblHomePage"); panel.SetColumnSpan(this.lblHomePage, 2); this.lblHomePage.Name = "lblHomePage"; this.lblHomePage.TabStop = true; this.lblHomePage.Tag = "http://www.nomad-net.info"; this.lblHomePage.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lblHomePage_LinkClicked); manager.ApplyResources(this.lblEMail, "lblEMail"); panel.SetColumnSpan(this.lblEMail, 2); this.lblEMail.Name = "lblEMail"; this.lblEMail.TabStop = true; this.lblEMail.Tag = "mailto:[email protected]"; this.lblEMail.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lblHomePage_LinkClicked); manager.ApplyResources(this.btnCheckForUpdates, "btnCheckForUpdates"); this.btnCheckForUpdates.Name = "btnCheckForUpdates"; this.btnCheckForUpdates.UseVisualStyleBackColor = true; this.btnCheckForUpdates.Click += new EventHandler(this.btnCheckForUpdates_Click); manager.ApplyResources(this.lblTarget, "lblTarget"); this.lblTarget.ForeColor = SystemColors.GrayText; this.lblTarget.Name = "lblTarget"; manager.ApplyResources(panel, "tlpBack"); panel.Controls.Add(this.lblNomad, 1, 0); panel.Controls.Add(this.lblTarget, 2, 0); panel.Controls.Add(this.lblVersion, 1, 1); panel.Controls.Add(this.lblCopyright, 1, 2); panel.Controls.Add(this.lblHomePage, 1, 3); panel.Controls.Add(this.lblEMail, 1, 4); panel.Controls.Add(box, 0, 0); panel.Controls.Add(this.tlpLicense, 0, 6); panel.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; panel.Name = "tlpBack"; manager.ApplyResources(this.tlpLicense, "tlpLicense"); panel.SetColumnSpan(this.tlpLicense, 3); this.tlpLicense.Controls.Add(this.lblLicense, 1, 0); this.tlpLicense.Controls.Add(this.imgLicense, 0, 0); this.tlpLicense.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; this.tlpLicense.Name = "tlpLicense"; this.tlpLicense.Paint += new PaintEventHandler(this.tlpLicense_Paint); manager.ApplyResources(this.imgLicense, "imgLicense"); this.imgLicense.Name = "imgLicense"; this.imgLicense.TabStop = false; manager.ApplyResources(panel2, "tlpButtons"); panel2.Controls.Add(this.btnCheckForUpdates, 0, 0); panel2.Controls.Add(this.btnClose, 2, 0); panel2.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; panel2.Name = "tlpButtons"; manager.ApplyResources(this.bvlButtons, "bvlButtons"); this.bvlButtons.ForeColor = SystemColors.ControlDarkDark; this.bvlButtons.Name = "bvlButtons"; this.bvlButtons.Sides = Border3DSide.Top; this.bvlButtons.Style = Border3DStyle.Flat; manager.ApplyResources(this, "$this"); base.AutoScaleMode = AutoScaleMode.Font; base.CancelButton = this.btnClose; base.Controls.Add(panel2); base.Controls.Add(this.bvlButtons); base.Controls.Add(panel); base.FormBorderStyle = FormBorderStyle.FixedDialog; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "AboutDialog"; base.ShowInTaskbar = false; ((ISupportInitialize) box).EndInit(); panel.ResumeLayout(false); panel.PerformLayout(); this.tlpLicense.ResumeLayout(false); this.tlpLicense.PerformLayout(); ((ISupportInitialize) this.imgLicense).EndInit(); panel2.ResumeLayout(false); panel2.PerformLayout(); base.ResumeLayout(false); base.PerformLayout(); }
private void InitializeComponent() { TableLayoutPanel _mainTableLayoutPanel = new TableLayoutPanel(); ComponentResourceManager resources = new ComponentResourceManager(typeof(AboutForm)); Button _okButton = new Button(); _mainTableLayoutPanel.SuspendLayout(); ((ISupportInitialize)this._logoPictureBox).BeginInit(); this.SuspendLayout(); // // _mainTableLayoutPanel // _mainTableLayoutPanel.ColumnCount = 2; _mainTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); _mainTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 67F)); _mainTableLayoutPanel.Controls.Add(this._logoPictureBox, 0, 0); _mainTableLayoutPanel.Controls.Add(this._productNameLabel, 1, 0); _mainTableLayoutPanel.Controls.Add(this._versionLabel, 1, 1); _mainTableLayoutPanel.Controls.Add(this._copyrightLabel, 1, 2); _mainTableLayoutPanel.Controls.Add(this._companyNameLabel, 1, 3); _mainTableLayoutPanel.Controls.Add(this._descriptionTextBox, 1, 4); _mainTableLayoutPanel.Controls.Add(_okButton, 1, 5); _mainTableLayoutPanel.Dock = DockStyle.Fill; _mainTableLayoutPanel.Location = new Point(9, 9); _mainTableLayoutPanel.Name = "_mainTableLayoutPanel"; _mainTableLayoutPanel.RowCount = 6; _mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 10F)); _mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 10F)); _mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 10F)); _mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 10F)); _mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); _mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 10F)); _mainTableLayoutPanel.Size = new Size(417, 265); _mainTableLayoutPanel.TabIndex = 0; // // _logoPictureBox // this._logoPictureBox.Dock = DockStyle.Fill; this._logoPictureBox.Image = (Image)resources.GetObject("_logoPictureBox.Image"); this._logoPictureBox.Location = new Point(3, 3); this._logoPictureBox.Name = "_logoPictureBox"; _mainTableLayoutPanel.SetRowSpan(this._logoPictureBox, 6); this._logoPictureBox.Size = new Size(131, 259); this._logoPictureBox.SizeMode = PictureBoxSizeMode.StretchImage; this._logoPictureBox.TabIndex = 12; this._logoPictureBox.TabStop = false; // // _productNameLabel // this._productNameLabel.Dock = DockStyle.Fill; this._productNameLabel.Location = new Point(143, 0); this._productNameLabel.Margin = new Padding(6, 0, 3, 0); this._productNameLabel.MaximumSize = new Size(0, 17); this._productNameLabel.Name = "_productNameLabel"; this._productNameLabel.Size = new Size(271, 17); this._productNameLabel.TabIndex = 19; this._productNameLabel.TextAlign = ContentAlignment.MiddleLeft; // // _versionLabel // this._versionLabel.Dock = DockStyle.Fill; this._versionLabel.Location = new Point(143, 26); this._versionLabel.Margin = new Padding(6, 0, 3, 0); this._versionLabel.MaximumSize = new Size(0, 17); this._versionLabel.Name = "_versionLabel"; this._versionLabel.Size = new Size(271, 17); this._versionLabel.TabIndex = 0; this._versionLabel.TextAlign = ContentAlignment.MiddleLeft; // // _copyrightLabel // this._copyrightLabel.Dock = DockStyle.Fill; this._copyrightLabel.Location = new Point(143, 52); this._copyrightLabel.Margin = new Padding(6, 0, 3, 0); this._copyrightLabel.MaximumSize = new Size(0, 17); this._copyrightLabel.Name = "_copyrightLabel"; this._copyrightLabel.Size = new Size(271, 17); this._copyrightLabel.TabIndex = 21; this._copyrightLabel.TextAlign = ContentAlignment.MiddleLeft; // // _companyNameLabel // this._companyNameLabel.Dock = DockStyle.Fill; this._companyNameLabel.Location = new Point(143, 78); this._companyNameLabel.Margin = new Padding(6, 0, 3, 0); this._companyNameLabel.MaximumSize = new Size(0, 17); this._companyNameLabel.Name = "_companyNameLabel"; this._companyNameLabel.Size = new Size(271, 17); this._companyNameLabel.TabIndex = 22; this._companyNameLabel.TextAlign = ContentAlignment.MiddleLeft; // // _descriptionTextBox // this._descriptionTextBox.Dock = DockStyle.Fill; this._descriptionTextBox.Location = new Point(143, 107); this._descriptionTextBox.Margin = new Padding(6, 3, 3, 3); this._descriptionTextBox.Multiline = true; this._descriptionTextBox.Name = "_descriptionTextBox"; this._descriptionTextBox.ReadOnly = true; this._descriptionTextBox.ScrollBars = ScrollBars.Both; this._descriptionTextBox.Size = new Size(271, 126); this._descriptionTextBox.TabIndex = 23; this._descriptionTextBox.TabStop = false; // // _okButton // _okButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; _okButton.DialogResult = DialogResult.Cancel; _okButton.Location = new Point(339, 239); _okButton.Name = "_okButton"; _okButton.Size = new Size(75, 23); _okButton.TabIndex = 24; _okButton.Text = Res.OKText; // // AboutForm // this.AcceptButton = _okButton; this.AutoScaleDimensions = new SizeF(6F, 13F); this.AutoScaleMode = AutoScaleMode.Font; this.CancelButton = _okButton; this.ClientSize = new Size(435, 283); this.Controls.Add(_mainTableLayoutPanel); this.FormBorderStyle = FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "AboutForm"; this.Padding = new Padding(9); this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = FormStartPosition.CenterParent; this.Text = Res.AboutText; _mainTableLayoutPanel.ResumeLayout(false); _mainTableLayoutPanel.PerformLayout(); ((ISupportInitialize)this._logoPictureBox).EndInit(); this.ResumeLayout(false); }
private void Initialize() { _view = new ListView(); _view.Dock = DockStyle.Fill; _panel = new TableLayoutPanel(); _panel.Dock = DockStyle.Fill; _panel.RowCount = 20; _panel.ColumnCount = 5; _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.125F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.25F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.25F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.125F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.25F)); _label1 = new Label(); _label2 = new Label(); _label3 = new Label(); _label4 = new Label(); _label5 = new Label(); _label6 = new Label(); _label7 = new Label(); _label8 = new Label(); _label9 = new Label(); _label10 = new Label(); _label11 = new Label(); _label12 = new Label(); _label13 = new Label(); _label1units = new Label(); _label2units = new Label(); _label3units = new Label(); _label4units = new Label(); _label5units = new Label(); _label6units = new Label(); _label7units = new Label(); _label8units = new Label(); _label9units = new Label(); _label10units = new Label(); _label11units = new Label(); _label12units = new Label(); _label13units = new Label(); Padding p = new Padding(0, 5, 0, 0); _label1.Margin = p; _label2.Margin = p; _label3.Margin = p; _label4.Margin = p; _label5.Margin = p; _label6.Margin = p; _label7.Margin = p; _label8.Margin = p; _label9.Margin = p; _label10.Margin = p; _label11.Margin = p; _label12.Margin = p; _label13.Margin = p; _label1.TextAlign = ContentAlignment.TopRight; _label2.TextAlign = ContentAlignment.TopRight; _label3.TextAlign = ContentAlignment.TopRight; _label4.TextAlign = ContentAlignment.TopRight; _label5.TextAlign = ContentAlignment.TopRight; _label6.TextAlign = ContentAlignment.TopRight; _label7.TextAlign = ContentAlignment.TopRight; _label8.TextAlign = ContentAlignment.TopRight; _label9.TextAlign = ContentAlignment.TopRight; _label10.TextAlign = ContentAlignment.TopRight; _label11.TextAlign = ContentAlignment.TopRight; _label12.TextAlign = ContentAlignment.TopRight; _label13.TextAlign = ContentAlignment.TopRight; _label1units.TextAlign = ContentAlignment.TopLeft; _label2units.TextAlign = ContentAlignment.TopLeft; _label3units.TextAlign = ContentAlignment.TopLeft; _label4units.TextAlign = ContentAlignment.TopLeft; _label5units.TextAlign = ContentAlignment.TopLeft; _label6units.TextAlign = ContentAlignment.TopLeft; _label7units.TextAlign = ContentAlignment.TopLeft; _label8units.TextAlign = ContentAlignment.TopLeft; _label9units.TextAlign = ContentAlignment.TopLeft; _label10units.TextAlign = ContentAlignment.TopLeft; _label11units.TextAlign = ContentAlignment.TopLeft; _label12units.TextAlign = ContentAlignment.TopLeft; _label13units.TextAlign = ContentAlignment.TopLeft; _label1.Dock = DockStyle.Right; _label2.Dock = DockStyle.Right; _label3.Dock = DockStyle.Right; _label4.Dock = DockStyle.Right; _label5.Dock = DockStyle.Right; _label6.Dock = DockStyle.Right; _label7.Dock = DockStyle.Right; _label8.Dock = DockStyle.Right; _label9.Dock = DockStyle.Right; _label10.Dock = DockStyle.Right; _label11.Dock = DockStyle.Right; _label12.Dock = DockStyle.Right; _label13.Dock = DockStyle.Right; _textBox1 = new TextBox(); _textBox2 = new TextBox(); _textBox3 = new TextBox(); _textBox4 = new TextBox(); _textBox5 = new TextBox(); _textBox6 = new TextBox(); _textBox7 = new TextBox(); _textBox8 = new TextBox(); _textBox9 = new TextBox(); _textBox10 = new TextBox(); _textBox11 = new TextBox(); _textBox12 = new TextBox(); _textBox13 = new TextBox(); _textBox1.Dock = DockStyle.Left; _textBox2.Dock = DockStyle.Left; _textBox3.Dock = DockStyle.Left; _textBox4.Dock = DockStyle.Left; _textBox5.Dock = DockStyle.Left; _textBox6.Dock = DockStyle.Left; _textBox7.Dock = DockStyle.Left; _textBox8.Dock = DockStyle.Left; _textBox9.Dock = DockStyle.Left; _textBox10.Dock = DockStyle.Left; _textBox11.Dock = DockStyle.Left; _textBox12.Dock = DockStyle.Left; _textBox13.Dock = DockStyle.Left; _label1.Text = "Name"; _label2.Text = "Peak Force"; _label3.Text = "Continuous Force No cooling"; _label4.Text = "Continuous Force 0psi"; _label5.Text = "Continuous Force 10psi"; _label6.Text = "Continuous Force 20psi"; _label7.Text = "Continuous Force 40psi"; _label8.Text = "Force Constant"; _label9.Text = "Motor Constant"; _label10.Text = "Back EMF"; _label11.Text = "Coil Resistance"; _label12.Text = "Coil Mass"; _label13.Text = "Coil Length"; _label1units.Text = ""; _label2units.Text = "N"; _label3units.Text = ""; _label4units.Text = "N"; _label5units.Text = "N"; _label6units.Text = "N"; _label7units.Text = "N"; _label8units.Text = "N/A(peak)"; _label9units.Text = "N/√W"; _label10units.Text = "V/(m/s)"; _label11units.Text = "Ω"; _label12units.Text = "kg"; _label13units.Text = "mm"; Label title = new Label(); title.Text = "Select an item from the list on the left, input the values for each parameter, and click OK to proceed."; title.Font = new Font("Tahoma", 10); title.Size = new Size(title.PreferredWidth, title.PreferredHeight); title.AutoSize = true; title.TextAlign = ContentAlignment.BottomCenter; title.Dock = DockStyle.Bottom; title.Anchor = AnchorStyles.Bottom; title.Margin = new Padding(0, 0, 0, 25); Button button = new Button(); button.Text = "Edit"; button.Click += new EventHandler(button_Click); button.Anchor = AnchorStyles.Top | AnchorStyles.Left; Button button2 = new Button(); button2.Text = "Delete"; button2.Click += new EventHandler(button2_Click); button2.Anchor = AnchorStyles.Top | AnchorStyles.Left; _panel.Controls.Add(_view, 1, 3); _panel.SetRowSpan(_view, 18); _panel.Controls.Add(_label1, 2, 3); _panel.Controls.Add(_label2, 2, 4); _panel.Controls.Add(_label4, 2, 5); _panel.Controls.Add(_label5, 2, 6); _panel.Controls.Add(_label6, 2, 7); _panel.Controls.Add(_label7, 2, 8); _panel.Controls.Add(_label8, 2, 9); _panel.Controls.Add(_label9, 2, 10); _panel.Controls.Add(_label10, 2, 11); _panel.Controls.Add(_label11, 2, 12); _panel.Controls.Add(_label12, 2, 13); _panel.Controls.Add(_label13, 2, 14); _panel.Controls.Add(_label1units, 4, 3); _panel.Controls.Add(_label2units, 4, 4); _panel.Controls.Add(_label4units, 4, 5); _panel.Controls.Add(_label5units, 4, 6); _panel.Controls.Add(_label6units, 4, 7); _panel.Controls.Add(_label7units, 4, 8); _panel.Controls.Add(_label8units, 4, 9); _panel.Controls.Add(_label9units, 4, 10); _panel.Controls.Add(_label10units, 4, 11); _panel.Controls.Add(_label11units, 4, 12); _panel.Controls.Add(_label12units, 4, 13); _panel.Controls.Add(_label13units, 4, 14); _panel.Controls.Add(_textBox1, 3, 3); _panel.Controls.Add(_textBox2, 3, 4); _panel.Controls.Add(_textBox4, 3, 5); _panel.Controls.Add(_textBox5, 3, 6); _panel.Controls.Add(_textBox6, 3, 7); _panel.Controls.Add(_textBox7, 3, 8); _panel.Controls.Add(_textBox8, 3, 9); _panel.Controls.Add(_textBox9, 3, 10); _panel.Controls.Add(_textBox10, 3, 11); _panel.Controls.Add(_textBox11, 3, 12); _panel.Controls.Add(_textBox12, 3, 13); _panel.Controls.Add(_textBox13, 3, 14); _panel.Controls.Add(title, 1, 1); _panel.SetColumnSpan(title, 2); _panel.SetRowSpan(title, 2); _panel.Controls.Add(button, 3, 16); _panel.Controls.Add(button2, 4, 16); }
public void TestExtenderMethods () { TableLayoutPanel p = new TableLayoutPanel (); Control c = new Button (); Assert.AreEqual (new TableLayoutPanelCellPosition (-1, -1), p.GetCellPosition (c), "A1"); Assert.AreEqual (-1, p.GetColumn (c), "A2"); Assert.AreEqual (1, p.GetColumnSpan (c), "A3"); Assert.AreEqual (-1, p.GetRow (c), "A4"); Assert.AreEqual (1, p.GetRowSpan (c), "A5"); p.SetCellPosition (c, new TableLayoutPanelCellPosition (1, 1)); Assert.AreEqual (new TableLayoutPanelCellPosition (1, 1), p.GetCellPosition (c), "A6"); p.SetColumn (c, 2); Assert.AreEqual (2, p.GetColumn (c), "A7"); p.SetRow (c, 2); Assert.AreEqual (2, p.GetRow (c), "A9"); p.SetColumnSpan (c, 2); Assert.AreEqual (2, p.GetColumnSpan (c), "A8"); p.SetRowSpan (c, 2); Assert.AreEqual (2, p.GetRowSpan (c), "A10"); Assert.AreEqual (new TableLayoutPanelCellPosition (2, 2), p.GetCellPosition (c), "A11"); // ??????? //Assert.AreEqual (new TableLayoutPanelCellPosition (-1, -1), p.GetPositionFromControl (c), "A12"); //Assert.AreEqual (c, p.GetControlFromPosition(0, 0), "A13"); }
public MyForm() { this.WindowState = FormWindowState.Maximized; this.Text = "Решение задачи Коши"; label_fxy = new Label{ Text = "Введите функцию y' = [f(x,y)]", Dock = DockStyle.Fill, Font = font, Height = controlsHeight }; box_fxy = new TextBox{ Dock = DockStyle.Fill, Font = font }; l_min = new Label{ Text = "Min:", Dock = DockStyle.Fill, Font = font, Height = controlsHeight }; b_min = new TextBox{ Dock = DockStyle.Fill, Font = font }; l_max = new Label{ Text = "Max:", Dock = DockStyle.Fill, Font = font, Height = controlsHeight }; b_max = new TextBox{ Dock = DockStyle.Fill, Font = font }; l_x = new Label{ Text = "X0", Dock = DockStyle.Fill, Font = font, Height = controlsHeight }; b_x = new TextBox{ Dock = DockStyle.Fill, Font = font }; l_y = new Label{ Text = "Y0:", Dock = DockStyle.Fill, Font = font, Height = controlsHeight }; b_y = new TextBox{ Dock = DockStyle.Fill, Font = font }; button = new Button {Text = "Нарисовать", Dock = DockStyle.Fill, Font = font, Height = controlsHeight + 10 }; picture = new PictureBox(){ Dock = DockStyle.Fill }; var table = new TableLayoutPanel(); table.RowStyles.Clear(); table.RowStyles.Add(new RowStyle(SizeType.Absolute, label_fxy.Height)); table.RowStyles.Add(new RowStyle(SizeType.Absolute, box_fxy.Height)); table.RowStyles.Add(new RowStyle(SizeType.Absolute, l_min.Height)); table.RowStyles.Add(new RowStyle(SizeType.Absolute, b_min.Height)); table.RowStyles.Add(new RowStyle(SizeType.Absolute, l_max.Height)); table.RowStyles.Add(new RowStyle(SizeType.Absolute, b_max.Height)); table.RowStyles.Add(new RowStyle(SizeType.Absolute, l_x.Height)); table.RowStyles.Add(new RowStyle(SizeType.Absolute, b_x.Height)); table.RowStyles.Add(new RowStyle(SizeType.Absolute, l_y.Height)); table.RowStyles.Add(new RowStyle(SizeType.Absolute, b_y.Height)); table.RowStyles.Add(new RowStyle(SizeType.Absolute, button.Height)); table.RowStyles.Add(new RowStyle(SizeType.AutoSize)); table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 400)); table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); table.Controls.Add(label_fxy, 0, 0); table.Controls.Add(box_fxy, 0, 1); table.Controls.Add(l_min, 0, 2); table.Controls.Add(b_min, 0, 3); table.Controls.Add(l_max, 0, 4); table.Controls.Add(b_max, 0, 5); table.Controls.Add(l_x, 0, 6); table.Controls.Add(b_x, 0, 7); table.Controls.Add(l_y, 0, 8); table.Controls.Add(b_y, 0, 9); table.Controls.Add(button, 0, 10); table.Controls.Add(new Panel(), 0, 11); table.Controls.Add(picture, 1, 0); table.SetRowSpan(picture, 12); table.Dock = DockStyle.Fill; Controls.Add(table); PrintGraphics(null, null); this.Resize += PrintGraphics; button.Click += PrintGraphics; }
/* * InitializeComponent */ private void InitializeComponent() { _okButton = new Button(); _cancelButton = new Button(); _addRootButton = new Button(); _addChildButton = new Button(); _deleteButton = new Button(); _moveDownButton = new Button(); _moveUpButton = new Button(); _propertyDescriptionLabel = new Label(); _treeViewDescriptionLabel = new Label(); _propertyGrid = new NuGenPropertyGrid(); _propertyGrid.Dock = DockStyle.Fill; _okCancelPanel = new TableLayoutPanel(); _nodeControlPanel = new TableLayoutPanel(); _overarchingTableLayoutPanel = new TableLayoutPanel(); _navigationButtonsTableLayoutPanel = new TableLayoutPanel(); _treeView = new NodesEditorTreeView(); _treeView.Dock = DockStyle.Fill; _okCancelPanel.SuspendLayout(); _nodeControlPanel.SuspendLayout(); _overarchingTableLayoutPanel.SuspendLayout(); _navigationButtonsTableLayoutPanel.SuspendLayout(); this.SuspendLayout(); _okCancelPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f)); _okCancelPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f)); _okCancelPanel.Controls.Add(_okButton, 0, 0); _okCancelPanel.Controls.Add(_cancelButton, 1, 0); _okCancelPanel.Dock = DockStyle.Right; _okCancelPanel.Margin = new Padding(3, 0, 0, 0); _okCancelPanel.RowStyles.Add(new RowStyle()); _okButton.DialogResult = DialogResult.OK; _okButton.Dock = DockStyle.Fill; _okButton.Text = Resources.Text_TreeNodeCollectionEditor_okButton; _cancelButton.DialogResult = DialogResult.Cancel; _cancelButton.Dock = DockStyle.Fill; _cancelButton.Text = Resources.Text_TreeNodeCollectionEditor_cancelButton; _nodeControlPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f)); _nodeControlPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50f)); _nodeControlPanel.Dock = DockStyle.Fill; _nodeControlPanel.Controls.Add(_addRootButton, 0, 0); _nodeControlPanel.Controls.Add(_addChildButton, 1, 0); _nodeControlPanel.Margin = new Padding(0, 3, 3, 3); _nodeControlPanel.RowStyles.Add(new RowStyle()); _addRootButton.Dock = DockStyle.Fill; _addRootButton.Margin = new Padding(0, 0, 3, 0); _addRootButton.Text = Resources.Text_TreeNodeCollectionEditor_addRootButton; _addChildButton.Dock = DockStyle.Fill; _addChildButton.Margin = new Padding(3, 0, 0, 0); _addChildButton.Text = Resources.Text_TreeNodeCollectionEditor_addChildButton; _deleteButton.Dock = DockStyle.Fill; _deleteButton.Margin = new Padding(0, 3, 0, 0); _deleteButton.Image = Resources.Delete; _deleteButton.Size = new Size(30, 30); _moveDownButton.Dock = DockStyle.Fill; _moveDownButton.Margin = new Padding(0, 1, 0, 3); _moveDownButton.Image = Resources.Down; _moveDownButton.Size = new Size(30, 30); _moveUpButton.Dock = DockStyle.Fill; _moveUpButton.Margin = new Padding(0, 0, 0, 1); _moveUpButton.Image = Resources.Up; _moveUpButton.Size = new Size(30, 30); _propertyGrid.LineColor = SystemColors.ScrollBar; _overarchingTableLayoutPanel.SetRowSpan(_propertyGrid, 2); _propertyDescriptionLabel.Dock = DockStyle.Fill; _propertyDescriptionLabel.Margin = new Padding(3, 1, 0, 0); _treeView.AllowDrop = true; _treeView.HideSelection = false; _treeView.Margin = new Padding(0, 3, 3, 3); _treeViewDescriptionLabel.Dock = DockStyle.Fill; _treeViewDescriptionLabel.Margin = new Padding(0, 1, 3, 0); _treeViewDescriptionLabel.Text = Resources.Text_TreeNodeCollectionEditor_treeViewDescriptionLabel; _overarchingTableLayoutPanel.Dock = DockStyle.Fill; _overarchingTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 250f)); _overarchingTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 40f)); _overarchingTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f)); _overarchingTableLayoutPanel.Controls.Add(_navigationButtonsTableLayoutPanel, 1, 1); _overarchingTableLayoutPanel.Controls.Add(_propertyDescriptionLabel, 2, 0); _overarchingTableLayoutPanel.Controls.Add(_propertyGrid, 2, 1); _overarchingTableLayoutPanel.Controls.Add(_treeView, 0, 1); _overarchingTableLayoutPanel.Controls.Add(_treeViewDescriptionLabel, 0, 0); _overarchingTableLayoutPanel.Controls.Add(_nodeControlPanel, 0, 2); _overarchingTableLayoutPanel.Controls.Add(_okCancelPanel, 2, 3); _overarchingTableLayoutPanel.RowStyles.Add(new RowStyle()); _overarchingTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100f)); _overarchingTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 30f)); _overarchingTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 30f)); _navigationButtonsTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); _navigationButtonsTableLayoutPanel.Controls.Add(_moveUpButton, 0, 0); _navigationButtonsTableLayoutPanel.Controls.Add(_deleteButton, 0, 2); _navigationButtonsTableLayoutPanel.Controls.Add(_moveDownButton, 0, 1); _navigationButtonsTableLayoutPanel.RowStyles.Add(new RowStyle()); _navigationButtonsTableLayoutPanel.RowStyles.Add(new RowStyle()); _navigationButtonsTableLayoutPanel.RowStyles.Add(new RowStyle()); this.AcceptButton = _okButton; this.AutoScaleMode = AutoScaleMode.Font; this.CancelButton = _cancelButton; this.Controls.Add(_overarchingTableLayoutPanel); this.Padding = new Padding(10); this.MaximizeBox = false; this.MinimizeBox = false; this.ShowIcon = false; this.ShowInTaskbar = false; this.Size = new Size(580, 480); this.MinimumSize = this.Size; this.Text = Resources.Text_TreeNodeCollectionEditor_EditorForm; _okCancelPanel.ResumeLayout(false); _okCancelPanel.PerformLayout(); _nodeControlPanel.ResumeLayout(false); _nodeControlPanel.PerformLayout(); _overarchingTableLayoutPanel.ResumeLayout(false); _overarchingTableLayoutPanel.PerformLayout(); _navigationButtonsTableLayoutPanel.ResumeLayout(false); base.ResumeLayout(false); }
public void TestCellPositioning16 () { // Row span = 2, but control is in the last row, creates new row TableLayoutPanel p = new TableLayoutPanel (); Control c1 = new Button (); Control c2 = new Button (); Control c3 = new Button (); p.ColumnCount = 2; p.RowCount = 2; p.SetRowSpan (c3, 2); p.SetCellPosition (c3, new TableLayoutPanelCellPosition (0, 1)); p.Controls.Add (c1); p.Controls.Add (c2); p.Controls.Add (c3); Assert.AreEqual (new TableLayoutPanelCellPosition (0, 0), p.GetPositionFromControl (c1), "C1"); Assert.AreEqual (new TableLayoutPanelCellPosition (1, 0), p.GetPositionFromControl (c2), "C2"); Assert.AreEqual (new TableLayoutPanelCellPosition (0, 1), p.GetPositionFromControl (c3), "C3"); }
public dashboardMarketEdit(DataTable _dataSource, Action<string, string> _UpdateSelectedMarket, LayoutPanelBase _CurrentLayout) { CurrentLayout = _CurrentLayout; if (null == _dataSource) throw new Exception ("invalid data source passed in"); UpdateSelectedMarket = _UpdateSelectedMarket; MarketFilters = BuildMarketFilterBox (); // NewMessage.Show ("boo"); ListOfMarkets = new ListBox (); if (_dataSource.PrimaryKey.Length == 0) { _dataSource.PrimaryKey = new DataColumn[] { _dataSource.Columns ["Guid"] }; } ViewOfTheData = new DataView (_dataSource); ViewOfTheData.Sort = "Caption ASC"; ViewOfTheData.ListChanged += new System.ComponentModel.ListChangedEventHandler (OnListChanged); //ViewOfTheData.RowFilter = BuildRowFilter(); ListOfMarkets.DataSource = ViewOfTheData;//_dataSource; ListOfMarkets.SelectedIndexChanged += HandleMarketListSelectedIndexChanged; ListOfMarkets.DisplayMember = "Caption"; //ListOfMarkets.DoubleClick+= HandleListOfDoubleClick; // ListOfMarkets.MouseDown+= HandleListOfMarketsMouseDown; //ListOfMarkets.Sorted = true; //ListOfMarkets.Width = 200; // // TAB CONTROL SIDE // TabControl Tabs = new TabControl (); Tabs.Dock = DockStyle.Fill; TabPage MarketEditing = new TabPage (); MarketEditing.Text = Loc.Instance.GetString ("Market Details"); TabPage MarketSubmissions = new TabPage (); MarketSubmissions.Text = Loc.Instance.GetString ("Market Submissions"); TabPage MarketNotes = new TabPage (); MarketNotes.Text = Loc.Instance.GetString ("Market Notes"); Tabs.TabPages.Add (MarketEditing); Tabs.TabPages.Add (MarketNotes); Tabs.TabPages.Add (MarketSubmissions); Tabs.SelectedIndexChanged += HandleMiniTabSelectedIndexChanged; SubLabel = new Label (); SubLabel.Text = Loc.Instance.GetString ("Submissions"); SubLabel.Dock = DockStyle.Top; DestLabel = new Label (); DestLabel.Dock = DockStyle.Bottom; DestLabel.Text = Loc.Instance.GetString ("Destinations"); PreviousSubmissions = new ListBox (); PreviousSubmissions.DoubleClick += HandlePreviousSubmissionsDoubleClick; PreviousSubmissions.Dock = DockStyle.Fill; //PreviousSubmissions.Height = 100; Destinations = new ListBox (); Destinations.Dock = DockStyle.Bottom; Destinations.Height = 100; tmpEditor = new PropertyGrid (); tmpEditor.Dock = DockStyle.Fill; tmpEditor.PropertyValueChanged += HandlePropertyValueChanged; tmpEditor.Height = 300; MarketEditing.Controls.Add (tmpEditor); MarketSubmissions.Controls.Add (DestLabel); MarketSubmissions.Controls.Add (PreviousSubmissions); PreviousSubmissions.BringToFront (); MarketSubmissions.Controls.Add (SubLabel); MarketSubmissions.Controls.Add (Destinations); // // MAIN TABlE // // Panel EasyMarketEdit = new Panel(); // EasyMarketEdit.BackColor = Color.Green; // EasyMarketEdit.Height = 200; // EasyMarketEdit.Dock = DockStyle.Fill; // EasyMarketEdit.Controls.Add (Tabs); // tmpEditor.Enabled = false; tmpEditor.BringToFront (); AddMarket = new Button (); AddMarket.Dock = DockStyle.Bottom; AddMarket.Text = Loc.Instance.GetString ("Add Market"); AddMarket.Click += HandleAddMarketClick; EditMarket = new Button (); EditMarket.Text = Loc.Instance.GetString ("Save Edits"); EditMarket.Dock = DockStyle.Fill; EditMarket.Enabled = false; EditMarket.Click += HandleEditMarketClick; EditMarketCancel = new Button (); EditMarketCancel.Dock = DockStyle.Fill; EditMarketCancel.Text = Loc.Instance.GetString ("Cancel Edit"); EditMarketCancel.Enabled = false; EditMarketCancel.Click += HandleEditMarketCancelClick; TableLayoutPanel MarketListPanel = new TableLayoutPanel (); MarketListPanel.RowCount = 2; MarketListPanel.ColumnCount = 3; MarketListPanel.Controls.Add (EditMarket, 1, 0); MarketListPanel.Controls.Add (AddMarket, 0, 0); MarketListPanel.Controls.Add (EditMarketCancel, 2, 0); //MarketListPanel.Controls.Add (EditMarketCancel, 1, 0); //MarketListPanel.Controls.Add (ListOfMarkets, 0, 1); MarketListPanel.Controls.Add (Tabs, 1, 1); MarketListPanel.SetColumnSpan (Tabs, 2); // MarketListPanel.Controls.Add (PreviousSubmissions, 1, 2); // MarketListPanel.Controls.Add (AddMarket, 0, 3); Panel RightSide = new Panel(); RightSide.Controls.Add (MarketFilters); RightSide.Controls.Add (ListOfMarkets); ListOfMarkets.Dock = DockStyle.Fill; ListOfMarkets.BringToFront(); RightSide.Dock = DockStyle.Fill; RightSide.BringToFront (); MarketListPanel.Controls.Add (RightSide, 0, 1); MarketListPanel.SetRowSpan(Tabs, 2); MarketListPanel.SetRowSpan(RightSide, 2); MarketListPanel.Dock = DockStyle.Fill; //this.Controls.Add (AddMarket); //NewMessage.Show ("boo2"); this.Controls.Add (MarketListPanel); MarketListPanel.BringToFront(); // AddMarket.SendToBack(); // // Setup Market Notes Pages // richBox = new RichTextBox(); MarketNotes.Controls.Add (richBox); richBox.Dock = DockStyle.Fill; richBox.KeyDown+= HandleNotesKeyDown; MarketListPanel.ColumnStyles.Clear(); for (int i = 0; i < MarketListPanel.ColumnCount; i++) { ColumnStyle style = new ColumnStyle(SizeType.Percent, 33.0f); MarketListPanel.ColumnStyles.Add(style); } MarketListPanel.RowStyles.Clear(); for (int i = 0; i < MarketListPanel.RowCount; i++) { MarketListPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize)); } }
private void Initialize() { _view = new ListView(); _view.Dock = DockStyle.Fill; _panel = new TableLayoutPanel(); _panel.Dock = DockStyle.Fill; _panel.RowCount = 7; _panel.ColumnCount = 5; _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.125F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.25F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.25F / 4F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.25F / 4F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.25F / 4F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.25F / 4F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.25F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.125F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.125F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.25F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.5F / 3F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.5F / 3F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.5F / 3F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.125F)); _boxAccel = new ComboBox(); _boxAccel.Items.Add(string.Format("Constant")); _boxAccel.Items.Add(string.Format("Triangular")); _boxAccel.Items.Add(string.Format("Sinusoidal")); _boxAccel.Width = 200; _boxAccel.Dock = DockStyle.Right; _boxAccel.Anchor = AnchorStyles.Top | AnchorStyles.Right; _boxTitle = new Label(); _boxTitle.Text = "Acceleration Type"; _boxTitle.Font = new Font("Tahoma", 10); _boxTitle.Size = new Size(_boxTitle.PreferredWidth, _boxTitle.PreferredHeight); _boxTitle.AutoSize = true; _boxTitle.TextAlign = ContentAlignment.BottomRight; _boxTitle.Anchor = AnchorStyles.Top | AnchorStyles.Right; _boxTitle.Margin = new Padding(0, 0, 0, 25); _label1 = new Label(); _label2 = new Label(); _label3 = new Label(); _label4 = new Label(); _label1.Enabled = false; _label2.Enabled = false; _label3.Enabled = false; _label4.Enabled = false; Padding p = new Padding(0, 5, 0, 0); _label1.Margin = p; _label2.Margin = p; _label3.Margin = p; _label4.Margin = p; _label1.TextAlign = ContentAlignment.TopRight; _label2.TextAlign = ContentAlignment.TopRight; _label3.TextAlign = ContentAlignment.TopRight; _label4.TextAlign = ContentAlignment.TopRight; _label1.Dock = DockStyle.Right; _label2.Dock = DockStyle.Right; _label3.Dock = DockStyle.Right; _label4.Dock = DockStyle.Right; _textBox1 = new TextBox(); _textBox2 = new TextBox(); _textBox3 = new TextBox(); _textBox4 = new TextBox(); _textBox1.Enabled = false; _textBox2.Enabled = false; _textBox3.Enabled = false; _textBox4.Enabled = false; _textBox1.Dock = DockStyle.Left; _textBox2.Dock = DockStyle.Left; _textBox3.Dock = DockStyle.Left; _textBox4.Dock = DockStyle.Left; _label1.Text = "Parameter 1"; _label2.Text = "Parameter 2"; _label3.Text = "Parameter 3"; _label4.Text = "Time Step"; Label boxTitle = new Label(); boxTitle.Text = "Creating axis:"; boxTitle.Font = new Font("Tahoma", 10); boxTitle.Size = new Size(boxTitle.PreferredWidth, boxTitle.PreferredHeight); boxTitle.AutoSize = true; boxTitle.TextAlign = ContentAlignment.BottomRight; boxTitle.Anchor = AnchorStyles.Top | AnchorStyles.Right; boxTitle.Dock = DockStyle.Fill; boxTitle.Margin = new Padding(0, 0, 0, 25); _box = new ComboBox(); _box.Items.Add(string.Format("Axis 1")); _box.Items.Add(string.Format("Axis 2")); _box.Items.Add(string.Format("Axis 3")); _box.Width = 200; _box.Dock = DockStyle.Right; _box.Anchor = AnchorStyles.Top | AnchorStyles.Right; Label title = new Label(); title.Text = "Select an item from the list on the left, input the values for each parameter, and click \"Create Axis\" to create that axis"; title.Font = new Font("Tahoma", 10); title.Size = new Size(title.PreferredWidth, title.PreferredHeight); title.AutoSize = true; title.TextAlign = ContentAlignment.BottomCenter; title.Dock = DockStyle.Bottom; title.Anchor = AnchorStyles.Bottom; title.Margin = new Padding(0, 0, 0, 25); Button button = new Button(); button.Text = "Create Axis"; button.Click += new EventHandler(button_Click); button.Anchor = AnchorStyles.Top | AnchorStyles.Left; Button finish = new Button(); finish.Text = "Finish Creating Axes"; finish.Click += new EventHandler(finish_Click); finish.Anchor = AnchorStyles.Top | AnchorStyles.Left; _panel.Controls.Add(_view, 0, 1); _panel.SetColumnSpan(_view, 2); _panel.SetRowSpan(_view, 6); _panel.Controls.Add(_label1, 2, 2); _panel.Controls.Add(_label2, 2, 3); _panel.Controls.Add(_label3, 2, 4); _panel.Controls.Add(_label4, 2, 5); _panel.Controls.Add(_textBox1, 3, 2); _panel.Controls.Add(_textBox2, 3, 3); _panel.Controls.Add(_textBox3, 3, 4); _panel.Controls.Add(_textBox4, 3, 5); _panel.Controls.Add(boxTitle, 4, 2); _panel.Controls.Add(_box, 4, 3); _panel.Controls.Add(_boxTitle, 4, 4); _panel.Controls.Add(_boxAccel, 4, 5); _panel.Controls.Add(title, 2, 1); _panel.SetColumnSpan(title, 2); _panel.Controls.Add(button, 3, 6); _panel.Controls.Add(finish, 4, 6); }
private void Initialize() { _panel = new TableLayoutPanel(); _panel.Dock = DockStyle.Fill; _panel.RowCount = 10; _panel.ColumnCount = 5; _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.125F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.25F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.25F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.25F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.125F)); _label1 = new Label(); _label2 = new Label(); _label3 = new Label(); _label4 = new Label(); _label5 = new Label(); Padding p = new Padding(0, 5, 0, 0); _label1.Margin = p; _label2.Margin = p; _label3.Margin = p; _label4.Margin = p; _label5.Margin = p; _label1.TextAlign = ContentAlignment.TopRight; _label2.TextAlign = ContentAlignment.TopRight; _label3.TextAlign = ContentAlignment.TopRight; _label4.TextAlign = ContentAlignment.TopRight; _label5.TextAlign = ContentAlignment.TopRight; _label1.Dock = DockStyle.Right; _label2.Dock = DockStyle.Right; _label3.Dock = DockStyle.Right; _label4.Dock = DockStyle.Right; _label5.Dock = DockStyle.Right; _textBox1 = new TextBox(); _textBox2 = new TextBox(); _textBox3 = new TextBox(); _textBox4 = new TextBox(); _textBox5 = new TextBox(); _textBox1.Dock = DockStyle.Left; _textBox2.Dock = DockStyle.Left; _textBox3.Dock = DockStyle.Left; _textBox4.Dock = DockStyle.Left; _textBox5.Dock = DockStyle.Left; _textBox1.Text = _mainForm.Project.Name; _textBox1.Width = 500; _textBox2.Width = 500; _textBox3.Width = 500; _textBox4.Width = 500; _textBox5.Width = 500; _textBox5.Multiline = true; _label1.Text = "Project Name"; _label2.Text = "Customer"; _label3.Text = "Application"; _label4.Text = "Sales Engineer"; _label5.Text = "Comments"; Button button = new Button(); button.Text = "Update Information"; button.Click += new EventHandler(button_Click); button.Anchor = AnchorStyles.Top | AnchorStyles.Left; dataGridView = new DataGridView(); dataGridView.ColumnCount = 2; dataGridView.Columns[0].Name = "Name"; dataGridView.Columns[1].Name = "Value"; dataGridView.Width = 500; dataGridView.Height = 700; string[] row = new string[] { "Customer", "" }; dataGridView.Rows.Add(row); row = new string[] { "Application", "" }; dataGridView.Rows.Add(row); row = new string[] { "Sale Engineer", "" }; dataGridView.Rows.Add(row); _panel.Controls.Add(_label1, 1, 1); _panel.Controls.Add(_textBox1, 2, 1); _panel.Controls.Add(dataGridView, 2, 2); _panel.SetColumnSpan(dataGridView, 3); _panel.SetRowSpan(dataGridView, 6); _panel.Controls.Add(button, 2, 8); }
private void InitializeComponent() { ComponentResourceManager manager = new ComponentResourceManager(typeof(ExceptionDialog)); this.imgIcon = new PictureBox(); this.btnDetails = new Button(); this.txtErrorDetails = new TextBox(); this.lblErrorMessage = new Label(); this.lblErrorNote = new Label(); this.lblSendError = new LinkLabel(); this.btnContinue = new Button(); this.btnCopyToClipboard = new Button(); this.btnQuit = new Button(); TableLayoutPanel panel = new TableLayoutPanel(); panel.SuspendLayout(); ((ISupportInitialize) this.imgIcon).BeginInit(); base.SuspendLayout(); manager.ApplyResources(panel, "tlpBack"); panel.Controls.Add(this.imgIcon, 0, 0); panel.Controls.Add(this.btnDetails, 0, 3); panel.Controls.Add(this.txtErrorDetails, 0, 4); panel.Controls.Add(this.lblErrorMessage, 1, 1); panel.Controls.Add(this.lblErrorNote, 1, 0); panel.Controls.Add(this.lblSendError, 1, 2); panel.Controls.Add(this.btnContinue, 5, 3); panel.Controls.Add(this.btnCopyToClipboard, 4, 3); panel.Controls.Add(this.btnQuit, 3, 3); panel.MaximumSize = new Size(0x1a8, 0); panel.Name = "tlpBack"; manager.ApplyResources(this.imgIcon, "imgIcon"); this.imgIcon.Name = "imgIcon"; panel.SetRowSpan(this.imgIcon, 2); this.imgIcon.TabStop = false; manager.ApplyResources(this.btnDetails, "btnDetails"); panel.SetColumnSpan(this.btnDetails, 2); this.btnDetails.Image = Resources.SmallDownArrow; this.btnDetails.Name = "btnDetails"; this.btnDetails.UseVisualStyleBackColor = true; this.btnDetails.Click += new EventHandler(this.btnDetails_Click); panel.SetColumnSpan(this.txtErrorDetails, 6); manager.ApplyResources(this.txtErrorDetails, "txtErrorDetails"); this.txtErrorDetails.Name = "txtErrorDetails"; this.txtErrorDetails.ReadOnly = true; manager.ApplyResources(this.lblErrorMessage, "lblErrorMessage"); panel.SetColumnSpan(this.lblErrorMessage, 5); this.lblErrorMessage.MaximumSize = new Size(0x16c, 0); this.lblErrorMessage.Name = "lblErrorMessage"; manager.ApplyResources(this.lblErrorNote, "lblErrorNote"); panel.SetColumnSpan(this.lblErrorNote, 5); this.lblErrorNote.MaximumSize = new Size(0x16c, 0); this.lblErrorNote.Name = "lblErrorNote"; manager.ApplyResources(this.lblSendError, "lblSendError"); panel.SetColumnSpan(this.lblSendError, 5); this.lblSendError.MaximumSize = new Size(0x16c, 0); this.lblSendError.Name = "lblSendError"; this.lblSendError.Tag = "mailto:[email protected]?subject=Exception: {0}"; this.lblSendError.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lblSendError_LinkClicked); manager.ApplyResources(this.btnContinue, "btnContinue"); this.btnContinue.DialogResult = DialogResult.Ignore; this.btnContinue.Name = "btnContinue"; this.btnContinue.UseVisualStyleBackColor = true; manager.ApplyResources(this.btnCopyToClipboard, "btnCopyToClipboard"); this.btnCopyToClipboard.Name = "btnCopyToClipboard"; this.btnCopyToClipboard.UseVisualStyleBackColor = true; this.btnCopyToClipboard.Click += new EventHandler(this.btnCopyToClipboard_Click); manager.ApplyResources(this.btnQuit, "btnQuit"); this.btnQuit.DialogResult = DialogResult.Abort; this.btnQuit.Name = "btnQuit"; this.btnQuit.UseVisualStyleBackColor = true; base.AcceptButton = this.btnContinue; manager.ApplyResources(this, "$this"); base.AutoScaleMode = AutoScaleMode.Font; base.CancelButton = this.btnContinue; base.Controls.Add(panel); base.FormBorderStyle = FormBorderStyle.FixedDialog; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "ExceptionDialog"; base.ShowInTaskbar = false; panel.ResumeLayout(false); panel.PerformLayout(); ((ISupportInitialize) this.imgIcon).EndInit(); base.ResumeLayout(false); base.PerformLayout(); }
private void InitializeComponent() { this.components = new Container(); ComponentResourceManager manager = new ComponentResourceManager(typeof(FormatsOptionControl)); PropertyValue value2 = new PropertyValue(); PropertyValue value3 = new PropertyValue(); PropertyValue value4 = new PropertyValue(); PropertyValue value5 = new PropertyValue(); PropertyValue value6 = new PropertyValue(); this.lblDateTimeFormat = new Label(); this.lblSizeFormat = new Label(); this.lblFolderNameSample = new Label(); this.lblDateTimeSample = new Label(); this.lblFileNameSample = new Label(); this.btnDateTimeFormat = new Button(); this.lblSizeSample = new Label(); this.lblFileNameCasing = new Label(); this.lblFolderNameCasing = new Label(); this.txtDateTimeFormat = new TextBox(); this.cmbFolderNameCasing = new ComboBoxEx(); this.cmbSizeFormat = new ComboBoxEx(); this.cmbFileNameCasing = new ComboBoxEx(); this.lblFolderNameTemplate = new Label(); this.cmbFolderNameTemplate = new ComboBoxEx(); this.cmsDateTimeFormat = new ContextMenuStrip(this.components); this.ValuesWatcher = new PropertyValuesWatcher(); ToolStripMenuItem item = new ToolStripMenuItem(); ToolStripMenuItem item2 = new ToolStripMenuItem(); ToolStripSeparator separator = new ToolStripSeparator(); ToolStripMenuItem item3 = new ToolStripMenuItem(); ToolStripMenuItem item4 = new ToolStripMenuItem(); ToolStripSeparator separator2 = new ToolStripSeparator(); ToolStripMenuItem item5 = new ToolStripMenuItem(); ToolStripMenuItem item6 = new ToolStripMenuItem(); ToolStripSeparator separator3 = new ToolStripSeparator(); ToolStripMenuItem item7 = new ToolStripMenuItem(); ToolStripMenuItem item8 = new ToolStripMenuItem(); ToolStripSeparator separator4 = new ToolStripSeparator(); ToolStripMenuItem item9 = new ToolStripMenuItem(); ToolStripMenuItem item10 = new ToolStripMenuItem(); ToolStripMenuItem item11 = new ToolStripMenuItem(); ToolStripMenuItem item12 = new ToolStripMenuItem(); ToolStripSeparator separator5 = new ToolStripSeparator(); ToolStripMenuItem item13 = new ToolStripMenuItem(); ToolStripMenuItem item14 = new ToolStripMenuItem(); ToolStripMenuItem item15 = new ToolStripMenuItem(); ToolStripMenuItem item16 = new ToolStripMenuItem(); ToolStripSeparator separator6 = new ToolStripSeparator(); ToolStripMenuItem item17 = new ToolStripMenuItem(); ToolStripMenuItem item18 = new ToolStripMenuItem(); ToolStripMenuItem item19 = new ToolStripMenuItem(); ToolStripMenuItem item20 = new ToolStripMenuItem(); ToolStripMenuItem item21 = new ToolStripMenuItem(); ToolStripSeparator separator7 = new ToolStripSeparator(); ToolStripMenuItem item22 = new ToolStripMenuItem(); ToolStripMenuItem item23 = new ToolStripMenuItem(); ToolStripMenuItem item24 = new ToolStripMenuItem(); ToolStripMenuItem item25 = new ToolStripMenuItem(); ToolStripSeparator separator8 = new ToolStripSeparator(); ToolStripMenuItem item26 = new ToolStripMenuItem(); ToolStripMenuItem item27 = new ToolStripMenuItem(); ToolStripSeparator separator9 = new ToolStripSeparator(); ToolStripMenuItem item28 = new ToolStripMenuItem(); ToolStripMenuItem item29 = new ToolStripMenuItem(); ToolStripSeparator separator10 = new ToolStripSeparator(); ToolStripMenuItem item30 = new ToolStripMenuItem(); ToolStripMenuItem item31 = new ToolStripMenuItem(); TableLayoutPanel panel = new TableLayoutPanel(); panel.SuspendLayout(); this.cmsDateTimeFormat.SuspendLayout(); ((ISupportInitialize) this.ValuesWatcher).BeginInit(); base.SuspendLayout(); item.Name = "tsmiPatternGeneralDateShortTime"; manager.ApplyResources(item, "tsmiPatternGeneralDateShortTime"); item.Tag = "g"; item.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item.Click += new EventHandler(this.tsmiStandardDatePattern_Click); item2.Name = "tsmiPatternGeneralDateLongTime"; manager.ApplyResources(item2, "tsmiPatternGeneralDateLongTime"); item2.Tag = "G"; item2.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item2.Click += new EventHandler(this.tsmiStandardDatePattern_Click); separator.Name = "tssStandardPattern1"; manager.ApplyResources(separator, "tssStandardPattern1"); separator.Click += new EventHandler(this.tsmiStandardDatePattern_Click); item3.Name = "tsmiPatternFullDateShortTime"; manager.ApplyResources(item3, "tsmiPatternFullDateShortTime"); item3.Tag = "f"; item3.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item3.Click += new EventHandler(this.tsmiStandardDatePattern_Click); item4.Name = "tsmiPatternFullDateLongTime"; manager.ApplyResources(item4, "tsmiPatternFullDateLongTime"); item4.Tag = "F"; item4.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item4.Click += new EventHandler(this.tsmiStandardDatePattern_Click); separator2.Name = "tssStandardPattern2"; manager.ApplyResources(separator2, "tssStandardPattern2"); separator2.Click += new EventHandler(this.tsmiStandardDatePattern_Click); item5.Name = "tsmiPatternShortDate"; manager.ApplyResources(item5, "tsmiPatternShortDate"); item5.Tag = "d"; item5.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item5.Click += new EventHandler(this.tsmiStandardDatePattern_Click); item6.Name = "tsmiPatternLongDate"; manager.ApplyResources(item6, "tsmiPatternLongDate"); item6.Tag = "D"; item6.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item6.Click += new EventHandler(this.tsmiStandardDatePattern_Click); separator3.Name = "tssStandardPattern3"; manager.ApplyResources(separator3, "tssStandardPattern3"); item7.DropDownItems.AddRange(new ToolStripItem[] { item8, separator4, item9, item10, item11, item12, separator5, item13, item14, item15, item16, separator6, item17, item18, item19 }); item7.Name = "tsmiCustomDateFormat"; manager.ApplyResources(item7, "tsmiCustomDateFormat"); item8.Name = "tsmiPatternDateSeparator"; manager.ApplyResources(item8, "tsmiPatternDateSeparator"); item8.Tag = "/"; item8.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item8.Click += new EventHandler(this.tsmiCustomDatePattern_Click); separator4.Name = "tssCustomDatePattern1"; manager.ApplyResources(separator4, "tssCustomDatePattern1"); item9.Name = "tsmiPatternDay1"; manager.ApplyResources(item9, "tsmiPatternDay1"); item9.Tag = "d"; item9.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item9.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item10.Name = "tsmiPatternDay2"; manager.ApplyResources(item10, "tsmiPatternDay2"); item10.Tag = "dd"; item10.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item10.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item11.Name = "tsmiPatternAbbreviatedDayName"; manager.ApplyResources(item11, "tsmiPatternAbbreviatedDayName"); item11.Tag = "ddd"; item11.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item11.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item12.Name = "tsmiPatternFullDayName"; manager.ApplyResources(item12, "tsmiPatternFullDayName"); item12.Tag = "dddd"; item12.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item12.Click += new EventHandler(this.tsmiCustomDatePattern_Click); separator5.Name = "tssCustomDatePattern2"; manager.ApplyResources(separator5, "tssCustomDatePattern2"); item13.Name = "tsmiPatternMonth1"; manager.ApplyResources(item13, "tsmiPatternMonth1"); item13.Tag = "M"; item13.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item13.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item14.Name = "tsmiPatternMonth2"; manager.ApplyResources(item14, "tsmiPatternMonth2"); item14.Tag = "MM"; item14.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item14.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item15.Name = "tsmiPatternAbbreviatedMonthName"; manager.ApplyResources(item15, "tsmiPatternAbbreviatedMonthName"); item15.Tag = "MMM"; item15.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item15.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item16.Name = "tsmiPatternFullMonthName"; manager.ApplyResources(item16, "tsmiPatternFullMonthName"); item16.Tag = "MMMM"; item16.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item16.Click += new EventHandler(this.tsmiCustomDatePattern_Click); separator6.Name = "tssCustomDatePattern3"; manager.ApplyResources(separator6, "tssCustomDatePattern3"); item17.Name = "tsmiPatternYear1"; manager.ApplyResources(item17, "tsmiPatternYear1"); item17.Tag = "y"; item17.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item17.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item18.Name = "tsmiPatternYear2"; manager.ApplyResources(item18, "tsmiPatternYear2"); item18.Tag = "yy"; item18.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item18.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item19.Name = "tsmiPatternYear3"; manager.ApplyResources(item19, "tsmiPatternYear3"); item19.Tag = "yyyy"; item19.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item19.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item20.DropDownItems.AddRange(new ToolStripItem[] { item21, separator7, item22, item23, item24, item25, separator8, item26, item27, separator9, item28, item29, separator10, item30, item31 }); item20.Name = "tsmiCustomTimeFormat"; manager.ApplyResources(item20, "tsmiCustomTimeFormat"); item21.Name = "tsmiPatternTimeSeparator"; manager.ApplyResources(item21, "tsmiPatternTimeSeparator"); item21.Tag = ":"; item21.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item21.Click += new EventHandler(this.tsmiCustomDatePattern_Click); separator7.Name = "tssCustomTimePattern1"; manager.ApplyResources(separator7, "tssCustomTimePattern1"); item22.Name = "tsmiPatternHour1"; manager.ApplyResources(item22, "tsmiPatternHour1"); item22.Tag = "h"; item22.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item22.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item23.Name = "tsmiPatternHour2"; manager.ApplyResources(item23, "tsmiPatternHour2"); item23.Tag = "hh"; item23.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item23.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item24.Name = "tsmiPatternHour3"; manager.ApplyResources(item24, "tsmiPatternHour3"); item24.Tag = "H"; item24.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item24.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item25.Name = "tsmiPatternHour4"; manager.ApplyResources(item25, "tsmiPatternHour4"); item25.Tag = "HH"; item25.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item25.Click += new EventHandler(this.tsmiCustomDatePattern_Click); separator8.Name = "tssCustomTimePattern2"; manager.ApplyResources(separator8, "tssCustomTimePattern2"); item26.Name = "tsmiPatternAMPM"; manager.ApplyResources(item26, "tsmiPatternAMPM"); item26.Tag = "tt"; item26.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item26.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item27.Name = "tsmiPatternShortAMPM"; manager.ApplyResources(item27, "tsmiPatternShortAMPM"); item27.Tag = "t"; item27.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item27.Click += new EventHandler(this.tsmiCustomDatePattern_Click); separator9.Name = "tssCustomTimePattern3"; manager.ApplyResources(separator9, "tssCustomTimePattern3"); item28.Name = "tsmiPatternMinute1"; manager.ApplyResources(item28, "tsmiPatternMinute1"); item28.Tag = "m"; item28.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item28.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item29.Name = "tsmiPatternMinute2"; manager.ApplyResources(item29, "tsmiPatternMinute2"); item29.Tag = "mm"; item29.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item29.Click += new EventHandler(this.tsmiCustomDatePattern_Click); separator10.Name = "tssCustomTimePattern4"; manager.ApplyResources(separator10, "tssCustomTimePattern4"); item30.Name = "tsmiPatternSeconds1"; manager.ApplyResources(item30, "tsmiPatternSeconds1"); item30.Tag = "s"; item30.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item30.Click += new EventHandler(this.tsmiCustomDatePattern_Click); item31.Name = "tsmiPatternSeconds2"; manager.ApplyResources(item31, "tsmiPatternSeconds2"); item31.Tag = "ss"; item31.Paint += new PaintEventHandler(this.tsmiStandardDatePattern_Paint); item31.Click += new EventHandler(this.tsmiCustomDatePattern_Click); manager.ApplyResources(panel, "tlpBack"); panel.Controls.Add(this.lblDateTimeFormat, 0, 0); panel.Controls.Add(this.lblSizeFormat, 0, 1); panel.Controls.Add(this.lblFolderNameSample, 2, 3); panel.Controls.Add(this.lblDateTimeSample, 3, 0); panel.Controls.Add(this.lblFileNameSample, 2, 2); panel.Controls.Add(this.btnDateTimeFormat, 2, 0); panel.Controls.Add(this.lblSizeSample, 2, 1); panel.Controls.Add(this.lblFileNameCasing, 0, 2); panel.Controls.Add(this.lblFolderNameCasing, 0, 3); panel.Controls.Add(this.txtDateTimeFormat, 1, 0); panel.Controls.Add(this.cmbFolderNameCasing, 1, 3); panel.Controls.Add(this.cmbSizeFormat, 1, 1); panel.Controls.Add(this.cmbFileNameCasing, 1, 2); panel.Controls.Add(this.lblFolderNameTemplate, 0, 4); panel.Controls.Add(this.cmbFolderNameTemplate, 1, 4); panel.Name = "tlpBack"; manager.ApplyResources(this.lblDateTimeFormat, "lblDateTimeFormat"); this.lblDateTimeFormat.Name = "lblDateTimeFormat"; manager.ApplyResources(this.lblSizeFormat, "lblSizeFormat"); this.lblSizeFormat.Name = "lblSizeFormat"; manager.ApplyResources(this.lblFolderNameSample, "lblFolderNameSample"); panel.SetColumnSpan(this.lblFolderNameSample, 2); this.lblFolderNameSample.Name = "lblFolderNameSample"; panel.SetRowSpan(this.lblFolderNameSample, 2); manager.ApplyResources(this.lblDateTimeSample, "lblDateTimeSample"); this.lblDateTimeSample.Name = "lblDateTimeSample"; manager.ApplyResources(this.lblFileNameSample, "lblFileNameSample"); panel.SetColumnSpan(this.lblFileNameSample, 2); this.lblFileNameSample.Name = "lblFileNameSample"; this.btnDateTimeFormat.Image = Resources.SmallDownArrow; manager.ApplyResources(this.btnDateTimeFormat, "btnDateTimeFormat"); this.btnDateTimeFormat.Name = "btnDateTimeFormat"; this.btnDateTimeFormat.UseVisualStyleBackColor = true; this.btnDateTimeFormat.Click += new EventHandler(this.btnDateTimeFormat_Click); manager.ApplyResources(this.lblSizeSample, "lblSizeSample"); panel.SetColumnSpan(this.lblSizeSample, 2); this.lblSizeSample.Name = "lblSizeSample"; manager.ApplyResources(this.lblFileNameCasing, "lblFileNameCasing"); this.lblFileNameCasing.Name = "lblFileNameCasing"; manager.ApplyResources(this.lblFolderNameCasing, "lblFolderNameCasing"); this.lblFolderNameCasing.Name = "lblFolderNameCasing"; manager.ApplyResources(this.txtDateTimeFormat, "txtDateTimeFormat"); this.txtDateTimeFormat.Name = "txtDateTimeFormat"; this.txtDateTimeFormat.TextChanged += new EventHandler(this.txtDateTimeFormat_TextChanged); manager.ApplyResources(this.cmbFolderNameCasing, "cmbFolderNameCasing"); this.cmbFolderNameCasing.DropDownStyle = ComboBoxStyle.DropDownList; this.cmbFolderNameCasing.FormattingEnabled = true; this.cmbFolderNameCasing.Name = "cmbFolderNameCasing"; this.cmbFolderNameCasing.SelectedIndexChanged += new EventHandler(this.cmbFolderNameCasing_SelectedIndexChanged); manager.ApplyResources(this.cmbSizeFormat, "cmbSizeFormat"); this.cmbSizeFormat.DropDownStyle = ComboBoxStyle.DropDownList; this.cmbSizeFormat.FormattingEnabled = true; this.cmbSizeFormat.Name = "cmbSizeFormat"; this.cmbSizeFormat.SelectedIndexChanged += new EventHandler(this.cmbSizeFormat_SelectedIndexChanged); manager.ApplyResources(this.cmbFileNameCasing, "cmbFileNameCasing"); this.cmbFileNameCasing.DropDownStyle = ComboBoxStyle.DropDownList; this.cmbFileNameCasing.FormattingEnabled = true; this.cmbFileNameCasing.Name = "cmbFileNameCasing"; this.cmbFileNameCasing.SelectedIndexChanged += new EventHandler(this.cmbFileNameCasing_SelectedIndexChanged); manager.ApplyResources(this.lblFolderNameTemplate, "lblFolderNameTemplate"); this.lblFolderNameTemplate.Name = "lblFolderNameTemplate"; manager.ApplyResources(this.cmbFolderNameTemplate, "cmbFolderNameTemplate"); this.cmbFolderNameTemplate.DisplayMember = "Key"; this.cmbFolderNameTemplate.DropDownStyle = ComboBoxStyle.DropDownList; this.cmbFolderNameTemplate.FormattingEnabled = true; this.cmbFolderNameTemplate.Items.AddRange(new object[] { manager.GetString("cmbFolderNameTemplate.Items") }); this.cmbFolderNameTemplate.Name = "cmbFolderNameTemplate"; this.cmbFolderNameTemplate.ValueMember = "Value"; this.cmbFolderNameTemplate.SelectedIndexChanged += new EventHandler(this.cmbFolderNameCasing_SelectedIndexChanged); this.cmsDateTimeFormat.Items.AddRange(new ToolStripItem[] { item, item2, separator, item3, item4, separator2, item5, item6, separator3, item7, item20 }); this.cmsDateTimeFormat.Name = "cmsDateTimeFormat"; manager.ApplyResources(this.cmsDateTimeFormat, "cmsDateTimeFormat"); value2.DataObject = this.txtDateTimeFormat; value2.PropertyName = "Text"; value3.DataObject = this.cmbSizeFormat; value3.PropertyName = "SelectedItem"; value4.DataObject = this.cmbFileNameCasing; value4.PropertyName = "SelectedItem"; value5.DataObject = this.cmbFolderNameCasing; value5.PropertyName = "SelectedItem"; value6.DataObject = this.cmbFolderNameTemplate; value6.PropertyName = "SelectedIndex"; this.ValuesWatcher.Items.AddRange(new PropertyValue[] { value2, value3, value4, value5, value6 }); manager.ApplyResources(this, "$this"); base.AutoScaleMode = AutoScaleMode.Font; base.Controls.Add(panel); base.Name = "FormatsOptionControl"; panel.ResumeLayout(false); panel.PerformLayout(); this.cmsDateTimeFormat.ResumeLayout(false); ((ISupportInitialize) this.ValuesWatcher).EndInit(); base.ResumeLayout(false); base.PerformLayout(); }
private void ShowZoomButton(ref Button btnZoom, Font font, TableLayoutPanel ZoomButtonParent, SendToEditorForms eOutputForm, bool bIsLegacy, DataGridViewCell aCell) { if (aCell.Value == null) return; ZoomButtonParent.SuspendLayout(); if (btnZoom == null) { btnZoom = new Button(); Font fontLarge = Program.GetSafeFont(font.Name, font.SizeInPoints * 3); btnZoom.Font = fontLarge; btnZoom.Anchor = AnchorStyles.None; btnZoom.BackColor = System.Drawing.SystemColors.Menu; btnZoom.MouseDown += new MouseEventHandler(btnZoom_MouseDown); btnZoom.Tag = eOutputForm; ZoomButtonParent.Controls.Add(btnZoom, 2, 0); ZoomButtonParent.SetRowSpan(btnZoom, 2); } // initialize it with the space padded character and then get the preferred size // (pad with a space on the left to correctly display 'zero forward offset' glyphs // and on the right, so it's centered and looks nicer). btnZoom.Text = String.Format("{0}", aCell.Value.ToString()); Size sz = btnZoom.GetPreferredSize(btnZoom.Size); btnZoom.Size = new Size(sz.Width, sz.Height); ZoomButtonParent.ResumeLayout(); ZoomButtonParent.PerformLayout(); // then fill it with the details from the clicked character string strTooltip = aCell.ToolTipText; int nIndexDelimiter = strTooltip.LastIndexOf(';'); strTooltip = GetCellToolTip(aCell, eOutputForm, bIsLegacy) + "; Click to insert in map"; toolTip.SetToolTip(btnZoom, strTooltip); return; }
private void InitializeComponent() { this.components = new Container(); ComponentResourceManager manager = new ComponentResourceManager(typeof(CustomizeFolderDialog)); PropertyValue value2 = new PropertyValue(); PropertyValue value3 = new PropertyValue(); PropertyValue value4 = new PropertyValue(); PropertyValue value5 = new PropertyValue(); PropertyValue value6 = new PropertyValue(); PropertyValue value7 = new PropertyValue(); PropertyValue value8 = new PropertyValue(); PropertyValue value9 = new PropertyValue(); this.btnCustomizeFilter = new Button(); this.btnCustomizeColumns = new Button(); this.cmbView = new ComboBox(); this.chkCustomizeColumns = new CheckBox(); this.chkCustomizeView = new CheckBox(); this.chkCustomizeFilter = new CheckBox(); this.chkCustomizeSort = new CheckBox(); this.btnCustomizeSort = new Button(); this.chkCustomizeIcon = new CheckBox(); this.btnBrowseIcon = new Button(); this.txtIconLocation = new TextBox(); this.pnlIcon = new PanelEx(); this.picIcon = new PictureBox(); this.btnListForeColor = new ColorButton(); this.btnListBackColor = new ColorButton(); this.chkApplyToChildren = new CheckBox(); this.btnOk = new Button(); this.btnCancel = new Button(); this.imgViews = new ImageList(this.components); this.CheckWatcher = new PropertyValuesWatcher(); this.BrowseIconDialog = new OpenFileDialog(); this.btnClear = new Button(); this.tlpBack = new TableLayoutPanel(); this.lblFolder = new Label(); this.tsFolder = new VirtualItemToolStrip(this.components); this.tlpButtons = new TableLayoutPanel(); this.bvlButtons = new Bevel(); GroupBox box = new GroupBox(); TableLayoutPanel panel = new TableLayoutPanel(); GroupBox box2 = new GroupBox(); TableLayoutPanel panel2 = new TableLayoutPanel(); GroupBox box3 = new GroupBox(); TableLayoutPanel panel3 = new TableLayoutPanel(); Label control = new Label(); Label label2 = new Label(); box.SuspendLayout(); panel.SuspendLayout(); box2.SuspendLayout(); panel2.SuspendLayout(); this.pnlIcon.SuspendLayout(); ((ISupportInitialize) this.picIcon).BeginInit(); box3.SuspendLayout(); panel3.SuspendLayout(); ((ISupportInitialize) this.CheckWatcher).BeginInit(); this.tlpBack.SuspendLayout(); this.tlpButtons.SuspendLayout(); base.SuspendLayout(); manager.ApplyResources(box, "grpOptions"); box.Controls.Add(panel); box.Name = "grpOptions"; box.TabStop = false; manager.ApplyResources(panel, "tlpOptions"); panel.Controls.Add(this.btnCustomizeFilter, 1, 0); panel.Controls.Add(this.btnCustomizeColumns, 1, 3); panel.Controls.Add(this.cmbView, 1, 2); panel.Controls.Add(this.chkCustomizeColumns, 0, 3); panel.Controls.Add(this.chkCustomizeView, 0, 2); panel.Controls.Add(this.chkCustomizeFilter, 0, 0); panel.Controls.Add(this.chkCustomizeSort, 0, 1); panel.Controls.Add(this.btnCustomizeSort, 1, 1); panel.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; panel.Name = "tlpOptions"; manager.ApplyResources(this.btnCustomizeFilter, "btnCustomizeFilter"); this.btnCustomizeFilter.Name = "btnCustomizeFilter"; this.btnCustomizeFilter.UseVisualStyleBackColor = true; this.btnCustomizeFilter.Click += new EventHandler(this.btnCustomizeFilter_Click); manager.ApplyResources(this.btnCustomizeColumns, "btnCustomizeColumns"); this.btnCustomizeColumns.Name = "btnCustomizeColumns"; this.btnCustomizeColumns.UseVisualStyleBackColor = true; this.btnCustomizeColumns.Click += new EventHandler(this.btnCustomizeColumns_Click); this.cmbView.DrawMode = DrawMode.OwnerDrawFixed; this.cmbView.DropDownStyle = ComboBoxStyle.DropDownList; manager.ApplyResources(this.cmbView, "cmbView"); this.cmbView.FormattingEnabled = true; this.cmbView.Name = "cmbView"; this.cmbView.DrawItem += new DrawItemEventHandler(this.cmbView_DrawItem); this.cmbView.SelectedIndexChanged += new EventHandler(this.UpdateButtons); manager.ApplyResources(this.chkCustomizeColumns, "chkCustomizeColumns"); this.chkCustomizeColumns.Name = "chkCustomizeColumns"; this.chkCustomizeColumns.UseVisualStyleBackColor = true; this.chkCustomizeColumns.CheckedChanged += new EventHandler(this.UpdateButtons); manager.ApplyResources(this.chkCustomizeView, "chkCustomizeView"); this.chkCustomizeView.Name = "chkCustomizeView"; this.chkCustomizeView.UseVisualStyleBackColor = true; this.chkCustomizeView.CheckedChanged += new EventHandler(this.UpdateButtons); manager.ApplyResources(this.chkCustomizeFilter, "chkCustomizeFilter"); this.chkCustomizeFilter.Name = "chkCustomizeFilter"; this.chkCustomizeFilter.UseVisualStyleBackColor = true; this.chkCustomizeFilter.CheckedChanged += new EventHandler(this.UpdateButtons); manager.ApplyResources(this.chkCustomizeSort, "chkCustomizeSort"); this.chkCustomizeSort.Name = "chkCustomizeSort"; this.chkCustomizeSort.UseVisualStyleBackColor = true; this.chkCustomizeSort.CheckedChanged += new EventHandler(this.UpdateButtons); manager.ApplyResources(this.btnCustomizeSort, "btnCustomizeSort"); this.btnCustomizeSort.Name = "btnCustomizeSort"; this.btnCustomizeSort.UseVisualStyleBackColor = true; this.btnCustomizeSort.Click += new EventHandler(this.btnCustomizeSort_Click); manager.ApplyResources(box2, "grpIcon"); box2.Controls.Add(panel2); box2.Name = "grpIcon"; box2.TabStop = false; manager.ApplyResources(panel2, "tlpIcon"); panel2.Controls.Add(this.chkCustomizeIcon, 0, 0); panel2.Controls.Add(this.btnBrowseIcon, 2, 2); panel2.Controls.Add(this.txtIconLocation, 1, 1); panel2.Controls.Add(this.pnlIcon, 0, 1); panel2.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; panel2.Name = "tlpIcon"; manager.ApplyResources(this.chkCustomizeIcon, "chkCustomizeIcon"); panel2.SetColumnSpan(this.chkCustomizeIcon, 3); this.chkCustomizeIcon.Name = "chkCustomizeIcon"; this.chkCustomizeIcon.UseVisualStyleBackColor = true; this.chkCustomizeIcon.CheckedChanged += new EventHandler(this.chkCustomizeIcon_CheckedChanged); manager.ApplyResources(this.btnBrowseIcon, "btnBrowseIcon"); this.btnBrowseIcon.Name = "btnBrowseIcon"; this.btnBrowseIcon.UseVisualStyleBackColor = true; this.btnBrowseIcon.Click += new EventHandler(this.btnBrowseIcon_Click); this.btnBrowseIcon.SizeChanged += new EventHandler(this.btnBrowseIcon_SizeChanged); panel2.SetColumnSpan(this.txtIconLocation, 2); manager.ApplyResources(this.txtIconLocation, "txtIconLocation"); this.txtIconLocation.Name = "txtIconLocation"; this.txtIconLocation.Validated += new EventHandler(this.txtIconLocation_Validated); this.txtIconLocation.Enter += new EventHandler(this.txtIconLocation_Enter); this.pnlIcon.BorderColor = Color.FromArgb(0xa7, 0xa6, 170); this.pnlIcon.Controls.Add(this.picIcon); manager.ApplyResources(this.pnlIcon, "pnlIcon"); this.pnlIcon.Name = "pnlIcon"; panel2.SetRowSpan(this.pnlIcon, 2); manager.ApplyResources(this.picIcon, "picIcon"); this.picIcon.Name = "picIcon"; this.picIcon.TabStop = false; manager.ApplyResources(box3, "grpListColors"); box3.Controls.Add(panel3); box3.Name = "grpListColors"; box3.TabStop = false; manager.ApplyResources(panel3, "tlpListColors"); panel3.Controls.Add(control, 0, 0); panel3.Controls.Add(this.btnListForeColor, 1, 1); panel3.Controls.Add(label2, 0, 1); panel3.Controls.Add(this.btnListBackColor, 1, 0); panel3.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; panel3.Name = "tlpListColors"; manager.ApplyResources(control, "lblListBackColor"); control.Name = "lblListBackColor"; this.btnListForeColor.Image = null; manager.ApplyResources(this.btnListForeColor, "btnListForeColor"); this.btnListForeColor.Name = "btnListForeColor"; this.btnListForeColor.UseVisualStyleBackColor = true; this.btnListForeColor.ColorChanged += new EventHandler(this.UpdateButtons); manager.ApplyResources(label2, "lblListForeColor"); label2.Name = "lblListForeColor"; this.btnListBackColor.Image = null; manager.ApplyResources(this.btnListBackColor, "btnListBackColor"); this.btnListBackColor.Name = "btnListBackColor"; this.btnListBackColor.UseVisualStyleBackColor = true; this.btnListBackColor.ColorChanged += new EventHandler(this.UpdateButtons); manager.ApplyResources(this.chkApplyToChildren, "chkApplyToChildren"); this.chkApplyToChildren.Name = "chkApplyToChildren"; this.chkApplyToChildren.UseVisualStyleBackColor = true; this.chkApplyToChildren.CheckedChanged += new EventHandler(this.UpdateButtons); manager.ApplyResources(this.btnOk, "btnOk"); this.btnOk.DialogResult = DialogResult.OK; this.btnOk.Name = "btnOk"; this.btnOk.UseVisualStyleBackColor = true; manager.ApplyResources(this.btnCancel, "btnCancel"); this.btnCancel.DialogResult = DialogResult.Cancel; this.btnCancel.Name = "btnCancel"; this.btnCancel.UseVisualStyleBackColor = true; this.imgViews.ColorDepth = ColorDepth.Depth32Bit; manager.ApplyResources(this.imgViews, "imgViews"); this.imgViews.TransparentColor = Color.Transparent; value2.DataObject = this.chkCustomizeFilter; value2.PropertyName = "Checked"; value3.DataObject = this.chkCustomizeSort; value3.PropertyName = "Checked"; value4.DataObject = this.chkCustomizeView; value4.PropertyName = "Checked"; value5.DataObject = this.chkCustomizeColumns; value5.PropertyName = "Checked"; value6.DataObject = this.chkCustomizeIcon; value6.PropertyName = "Checked"; value7.DataObject = this.btnListBackColor; value7.PropertyName = "Color"; value8.DataObject = this.btnListForeColor; value8.PropertyName = "Color"; value9.DataObject = this.chkApplyToChildren; value9.PropertyName = "Checked"; this.CheckWatcher.Items.AddRange(new PropertyValue[] { value2, value3, value4, value5, value6, value7, value8, value9 }); this.BrowseIconDialog.AddExtension = false; manager.ApplyResources(this.BrowseIconDialog, "BrowseIconDialog"); manager.ApplyResources(this.btnClear, "btnClear"); this.btnClear.Name = "btnClear"; this.btnClear.UseVisualStyleBackColor = true; this.btnClear.Click += new EventHandler(this.btnClear_Click); manager.ApplyResources(this.tlpBack, "tlpBack"); this.tlpBack.Controls.Add(this.lblFolder, 0, 0); this.tlpBack.Controls.Add(this.chkApplyToChildren, 0, 5); this.tlpBack.Controls.Add(box2, 0, 2); this.tlpBack.Controls.Add(this.tsFolder, 0, 1); this.tlpBack.Controls.Add(box, 0, 4); this.tlpBack.Controls.Add(box3, 0, 3); this.tlpBack.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; this.tlpBack.Name = "tlpBack"; manager.ApplyResources(this.lblFolder, "lblFolder"); this.lblFolder.Name = "lblFolder"; this.tsFolder.BackColor = SystemColors.ButtonFace; manager.ApplyResources(this.tsFolder, "tsFolder"); this.tsFolder.GripStyle = ToolStripGripStyle.Hidden; this.tsFolder.MinimumSize = new Size(0, 0x19); this.tsFolder.Name = "tsFolder"; manager.ApplyResources(this.tlpButtons, "tlpButtons"); this.tlpButtons.Controls.Add(this.btnOk, 1, 0); this.tlpButtons.Controls.Add(this.btnClear, 2, 0); this.tlpButtons.Controls.Add(this.btnCancel, 3, 0); this.tlpButtons.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; this.tlpButtons.Name = "tlpButtons"; manager.ApplyResources(this.bvlButtons, "bvlButtons"); this.bvlButtons.ForeColor = SystemColors.ControlDarkDark; this.bvlButtons.Name = "bvlButtons"; this.bvlButtons.Sides = Border3DSide.Top; this.bvlButtons.Style = Border3DStyle.Flat; base.AcceptButton = this.btnOk; manager.ApplyResources(this, "$this"); base.AutoScaleMode = AutoScaleMode.Font; base.CancelButton = this.btnCancel; base.Controls.Add(this.tlpButtons); base.Controls.Add(this.bvlButtons); base.Controls.Add(this.tlpBack); base.FixMouseWheel = Settings.Default.FixMouseWheel; base.FormBorderStyle = FormBorderStyle.FixedDialog; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "CustomizeFolderDialog"; base.ShowInTaskbar = false; base.Shown += new EventHandler(this.UpdateButtons); box.ResumeLayout(false); box.PerformLayout(); panel.ResumeLayout(false); panel.PerformLayout(); box2.ResumeLayout(false); box2.PerformLayout(); panel2.ResumeLayout(false); panel2.PerformLayout(); this.pnlIcon.ResumeLayout(false); ((ISupportInitialize) this.picIcon).EndInit(); box3.ResumeLayout(false); box3.PerformLayout(); panel3.ResumeLayout(false); panel3.PerformLayout(); ((ISupportInitialize) this.CheckWatcher).EndInit(); this.tlpBack.ResumeLayout(false); this.tlpBack.PerformLayout(); this.tlpButtons.ResumeLayout(false); this.tlpButtons.PerformLayout(); base.ResumeLayout(false); base.PerformLayout(); }
private void InitializeComponent() { this.components = new Container(); ComponentResourceManager manager = new ComponentResourceManager(typeof(ManageColumnsDialog)); this.lvItems = new ListViewEx(); this.imgAligns = new ImageList(this.components); this.btnUp = new Button(); this.btnHide = new Button(); this.btnShow = new Button(); this.btnDown = new Button(); this.tsAlign = new ToolStrip(); this.tsbLeftAlign = new ToolStripButton(); this.tsbCenter = new ToolStripButton(); this.tsbRightAlign = new ToolStripButton(); this.chkRememberColumns = new CheckBox(); this.chkAutosizeColumns = new CheckBox(); this.cmbTemplate = new TemplateComboBox(); this.btnDeleteTemplate = new Button(); this.btnSaveTemplate = new Button(); this.bvlButtons = new Bevel(); this.btnOk = new Button(); this.btnCancel = new Button(); this.tlpButtons = new TableLayoutPanel(); this.bvlTemplate = new Bevel(); TableLayoutPanel panel = new TableLayoutPanel(); ColumnHeader header = new ColumnHeader(); ColumnHeader header2 = new ColumnHeader(); Label control = new Label(); TableLayoutPanel panel2 = new TableLayoutPanel(); Label label2 = new Label(); panel.SuspendLayout(); this.tsAlign.SuspendLayout(); panel2.SuspendLayout(); this.tlpButtons.SuspendLayout(); base.SuspendLayout(); manager.ApplyResources(panel, "tlpBack"); panel.Controls.Add(this.lvItems, 0, 1); panel.Controls.Add(this.btnUp, 1, 1); panel.Controls.Add(this.btnHide, 1, 4); panel.Controls.Add(this.btnShow, 1, 3); panel.Controls.Add(this.btnDown, 1, 2); panel.Controls.Add(this.tsAlign, 1, 5); panel.Controls.Add(this.chkRememberColumns, 0, 8); panel.Controls.Add(this.chkAutosizeColumns, 0, 7); panel.Controls.Add(control, 0, 0); panel.Name = "tlpBack"; this.lvItems.AllowDrop = true; this.lvItems.CheckBoxes = true; this.lvItems.CollapsibleGroups = true; this.lvItems.Columns.AddRange(new ColumnHeader[] { header, header2 }); manager.ApplyResources(this.lvItems, "lvItems"); this.lvItems.ExplorerTheme = true; this.lvItems.FullRowSelect = true; this.lvItems.HeaderStyle = ColumnHeaderStyle.None; this.lvItems.HideSelection = false; this.lvItems.MultiSelect = false; this.lvItems.Name = "lvItems"; panel.SetRowSpan(this.lvItems, 6); this.lvItems.SmallImageList = this.imgAligns; this.lvItems.UseCompatibleStateImageBehavior = false; this.lvItems.View = View.Details; this.lvItems.ItemCheck += new ItemCheckEventHandler(this.lvItems_ItemCheck); this.lvItems.KeyDown += new KeyEventHandler(this.lvItems_KeyDown); this.lvItems.ItemDrag += new ItemDragEventHandler(this.lvItems_ItemDrag); this.lvItems.SelectedIndexChanged += new EventHandler(this.lvItems_SelectedIndexChanged); this.lvItems.ItemChecked += new ItemCheckedEventHandler(this.lvItems_ItemChecked); this.lvItems.ClientSizeChanged += new EventHandler(this.lvItems_ClientSizeChanged); manager.ApplyResources(header, "NameColumn"); manager.ApplyResources(header2, "WidthColumn"); this.imgAligns.ColorDepth = ColorDepth.Depth32Bit; manager.ApplyResources(this.imgAligns, "imgAligns"); this.imgAligns.TransparentColor = Color.Transparent; manager.ApplyResources(this.btnUp, "btnUp"); this.btnUp.Name = "btnUp"; this.btnUp.UseVisualStyleBackColor = true; this.btnUp.Click += new EventHandler(this.btnMove_Click); manager.ApplyResources(this.btnHide, "btnHide"); this.btnHide.Name = "btnHide"; this.btnHide.UseVisualStyleBackColor = true; this.btnHide.Click += new EventHandler(this.btnHide_Click); manager.ApplyResources(this.btnShow, "btnShow"); this.btnShow.Name = "btnShow"; this.btnShow.UseVisualStyleBackColor = true; this.btnShow.Click += new EventHandler(this.btnShow_Click); manager.ApplyResources(this.btnDown, "btnDown"); this.btnDown.Name = "btnDown"; this.btnDown.Tag = "1"; this.btnDown.UseVisualStyleBackColor = true; this.btnDown.Click += new EventHandler(this.btnMove_Click); this.tsAlign.BackColor = SystemColors.Control; this.tsAlign.GripStyle = ToolStripGripStyle.Hidden; this.tsAlign.Items.AddRange(new ToolStripItem[] { this.tsbLeftAlign, this.tsbCenter, this.tsbRightAlign }); manager.ApplyResources(this.tsAlign, "tsAlign"); this.tsAlign.Name = "tsAlign"; this.tsAlign.TabStop = true; this.tsbLeftAlign.DisplayStyle = ToolStripItemDisplayStyle.Image; manager.ApplyResources(this.tsbLeftAlign, "tsbLeftAlign"); this.tsbLeftAlign.Image = Resources.ImageThrobber; this.tsbLeftAlign.Name = "tsbLeftAlign"; this.tsbLeftAlign.Paint += new PaintEventHandler(this.tsbAlign_Paint); this.tsbLeftAlign.Click += new EventHandler(this.tsbAlign_Click); this.tsbCenter.DisplayStyle = ToolStripItemDisplayStyle.Image; manager.ApplyResources(this.tsbCenter, "tsbCenter"); this.tsbCenter.Image = Resources.ImageThrobber; this.tsbCenter.Name = "tsbCenter"; this.tsbCenter.Paint += new PaintEventHandler(this.tsbAlign_Paint); this.tsbCenter.Click += new EventHandler(this.tsbAlign_Click); this.tsbRightAlign.DisplayStyle = ToolStripItemDisplayStyle.Image; manager.ApplyResources(this.tsbRightAlign, "tsbRightAlign"); this.tsbRightAlign.Image = Resources.ImageThrobber; this.tsbRightAlign.Name = "tsbRightAlign"; this.tsbRightAlign.Paint += new PaintEventHandler(this.tsbAlign_Paint); this.tsbRightAlign.Click += new EventHandler(this.tsbAlign_Click); manager.ApplyResources(this.chkRememberColumns, "chkRememberColumns"); panel.SetColumnSpan(this.chkRememberColumns, 2); this.chkRememberColumns.Name = "chkRememberColumns"; this.chkRememberColumns.UseVisualStyleBackColor = true; manager.ApplyResources(this.chkAutosizeColumns, "chkAutosizeColumns"); panel.SetColumnSpan(this.chkAutosizeColumns, 2); this.chkAutosizeColumns.Name = "chkAutosizeColumns"; this.chkAutosizeColumns.UseVisualStyleBackColor = true; manager.ApplyResources(control, "lblColumns"); panel.SetColumnSpan(control, 2); control.Name = "lblColumns"; manager.ApplyResources(panel2, "tlpTemplate"); panel2.Controls.Add(label2, 0, 0); panel2.Controls.Add(this.cmbTemplate, 1, 0); panel2.Controls.Add(this.btnSaveTemplate, 2, 0); panel2.Controls.Add(this.btnDeleteTemplate, 3, 0); panel2.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; panel2.Name = "tlpTemplate"; manager.ApplyResources(label2, "lblTemplate"); label2.Name = "lblTemplate"; this.cmbTemplate.DeleteButton = this.btnDeleteTemplate; manager.ApplyResources(this.cmbTemplate, "cmbTemplate"); this.cmbTemplate.FormattingEnabled = true; this.cmbTemplate.Name = "cmbTemplate"; this.cmbTemplate.SaveButton = this.btnSaveTemplate; this.cmbTemplate.SelectionChangeCommitted += new EventHandler(this.cmbTemplate_SelectionChangeCommitted); this.cmbTemplate.Leave += new EventHandler(this.cmbTemplate_TextUpdate); this.cmbTemplate.Enter += new EventHandler(this.cmbTemplate_TextUpdate); this.cmbTemplate.TextUpdate += new EventHandler(this.cmbTemplate_TextUpdate); manager.ApplyResources(this.btnDeleteTemplate, "btnDeleteTemplate"); this.btnDeleteTemplate.Name = "btnDeleteTemplate"; this.btnDeleteTemplate.UseVisualStyleBackColor = true; manager.ApplyResources(this.btnSaveTemplate, "btnSaveTemplate"); this.btnSaveTemplate.Name = "btnSaveTemplate"; this.btnSaveTemplate.UseVisualStyleBackColor = true; this.btnSaveTemplate.Click += new EventHandler(this.btnSaveTemplate_Click); manager.ApplyResources(this.bvlButtons, "bvlButtons"); this.bvlButtons.ForeColor = SystemColors.ControlDarkDark; this.bvlButtons.Name = "bvlButtons"; this.bvlButtons.Sides = Border3DSide.Top; this.bvlButtons.Style = Border3DStyle.Flat; manager.ApplyResources(this.btnOk, "btnOk"); this.btnOk.DialogResult = DialogResult.OK; this.btnOk.Name = "btnOk"; this.btnOk.UseVisualStyleBackColor = true; manager.ApplyResources(this.btnCancel, "btnCancel"); this.btnCancel.DialogResult = DialogResult.Cancel; this.btnCancel.Name = "btnCancel"; this.btnCancel.UseVisualStyleBackColor = true; manager.ApplyResources(this.tlpButtons, "tlpButtons"); this.tlpButtons.Controls.Add(this.btnOk, 1, 0); this.tlpButtons.Controls.Add(this.btnCancel, 2, 0); this.tlpButtons.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; this.tlpButtons.Name = "tlpButtons"; manager.ApplyResources(this.bvlTemplate, "bvlTemplate"); this.bvlTemplate.ForeColor = SystemColors.ControlDarkDark; this.bvlTemplate.Name = "bvlTemplate"; this.bvlTemplate.Sides = Border3DSide.Top; base.AcceptButton = this.btnOk; manager.ApplyResources(this, "$this"); base.AutoScaleMode = AutoScaleMode.Font; base.CancelButton = this.btnCancel; base.Controls.Add(panel); base.Controls.Add(this.bvlTemplate); base.Controls.Add(this.bvlButtons); base.Controls.Add(this.tlpButtons); base.Controls.Add(panel2); base.FixMouseWheel = Settings.Default.FixMouseWheel; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "ManageColumnsDialog"; base.ShowInTaskbar = false; base.Shown += new EventHandler(this.ManageColumnsDialog_Shown); panel.ResumeLayout(false); panel.PerformLayout(); this.tsAlign.ResumeLayout(false); this.tsAlign.PerformLayout(); panel2.ResumeLayout(false); panel2.PerformLayout(); this.tlpButtons.ResumeLayout(false); this.tlpButtons.PerformLayout(); base.ResumeLayout(false); base.PerformLayout(); }
private void Initialize() { _panel = new TableLayoutPanel(); _panel.Dock = DockStyle.Fill; _panel.RowCount = 20; _panel.ColumnCount = 6; _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _unitLists = new Dictionary<string, string[]>(); _unitLists.Add("length", new string[] { "m", "mm", "cm", "in", "ft" }); _unitLists.Add("mass", new string[] { "kg", "g", "lb" }); _unitLists.Add("time", new string[] { "s", "ms", "min" }); _unitLists.Add("angle", new string[] { "rad", "deg", "rev" }); _unitLists.Add("percent", new string[] { "fraction", "%" }); _unitLists.Add("force", new string[] { "N", "lb" }); _unitLists.Add("friction", new string[] { "N/(m/s)", "lb/(m/s)" }); _unitLists.Add("velocity", new string[] { "m/s", "mm/s", "m/min", "in/s", "in/min" }); _unitLists.Add("acceleration", new string[] { "m/s^2", "mm/s^2", "m/min^2", "in/s^2", "in/min^2", "g" }); _unitLists.Add("temperature", new string[] { "\x00B0C", "\x00B0F", "K" }); _unitLists.Add("cooling", new string[] { "No Cooling", "10 PSI", "20 PSI", "40 PSI", "Vacuum" }); _unitLists.Add("none", new string[] { "None" }); _sequenceNameLabel = addLabel("Linear Movement Sequence"); _sequenceNameLabel.Font = new Font("Tahoma", 14, FontStyle.Bold); _inputs = addLabel("Inputs"); _inputs.Font = new Font("Tahoma", 10, FontStyle.Bold); _outputs = addLabel("Outputs"); _outputs.Font = new Font("Tahoma", 10, FontStyle.Bold); _maxStaticFrictionLabel = addLabel("Max Static Friction"); _dynamicFrictionLabel = addLabel("Dynamic Friction"); _ambientTemperatureLabel = addLabel("Ambient Temp."); _mechanicalEfficiencyLabel = addLabel("Mech. Efficiency"); _coolingLabel = addLabel("Cooling"); _stackedAxisDescription = addLabel("If an axis is stacked on top of this one:"); _stackedAxisLabel = addLabel("Stacked Axis"); _stackedMassLabel = addLabel("Stacked Mass"); _totalSeqTimeLabel = addLabel("Total Seq. Time"); _maxLinearSpeedLabel = addLabel("Max Linear Speed"); _peakAccelerationLabel = addLabel("Peak Acceleration"); _peakForceLabel = addLabel("Peak Force"); _totalRMSForceLabel = addLabel("RMS Force"); _peakCurrentLabel = addLabel("Peak Current"); _continuousCurrentLabel = addLabel("RMS Current"); _minBusVoltageLabel = addLabel("Min Bus Voltage"); _finalCoilTemperatureLabel = addLabel("Final Coil Temp."); _commentsLabel = addLabel("Comments"); _sequenceName = addTextBox(false); _maxStaticFriction = addTextBox(false); _dynamicFriction = addTextBox(false); _ambientTemperature = addTextBox(false); _mechanicalEfficiency = addTextBox(false); _stackedMass = addTextBox(true); _totalSeqTime = addTextBox(true); _maxLinearSpeed = addTextBox(true); _peakAcceleration = addTextBox(true); _peakForce = addTextBox(true); _totalRMSForce = addTextBox(true); _peakCurrent = addTextBox(true); _continuousCurrent = addTextBox(true); _minBusVoltage = addTextBox(true); _finalCoilTemperature = addTextBox(true); _comments = addTextBox(false); _comments.Multiline = true; _comments.Text = _project.SequenceComments; _comments.TextAlign = HorizontalAlignment.Left; _sequenceName.TextAlign = HorizontalAlignment.Left; _sequenceName.Name = "_sequenceName"; _comments.Name = "_comments"; _maxStaticFriction.Name = "_maxStaticFriction"; _dynamicFriction.Name = "_dynamicFriction"; _ambientTemperature.Name = "_ambientTemperature"; _mechanicalEfficiency.Name = "_mechanicalEfficiency"; _sequenceName.Text = _project.SequenceName; _maxStaticFriction.Text = "0"; _dynamicFriction.Text = "0"; _ambientTemperature.Text = "20"; _mechanicalEfficiency.Text = "95"; _maxStaticFrictionUnits = fillComboBox("force", 0); _dynamicFrictionUnits = fillComboBox("friction", 0); _ambientTemperatureUnits = fillComboBox("temperature", 0); _mechanicalEfficiencyUnits = fillComboBox("percent", 0); _cooling = fillComboBox("cooling", 0); _stackedAxis = fillComboBox("none", 0); _stackedMassUnits = fillComboBox("mass", 0); _totalSeqTimeUnits = fillComboBox("time", 1); _maxLinearSpeedUnits = fillComboBox("velocity", 0); _peakAccelerationUnits = fillComboBox("acceleration", 0); _peakForceUnits = fillComboBox("force", 0); _totalRMSForceUnits = fillComboBox("force", 0); _peakCurrentUnits = addLabel("A"); _continuousCurrentUnits = addLabel("A"); _minBusVoltageUnits = addLabel("V"); _finalCoilTemperatureUnits = fillComboBox("temperature", 0); _cooling.SelectedIndexChanged += new EventHandler(_cooling_SelectedIndexChanged); _panel.Controls.Add(_sequenceNameLabel, 0, 0); _panel.SetColumnSpan(_sequenceNameLabel, 2); _panel.Controls.Add(_inputs, 0, 2); _panel.Controls.Add(_maxStaticFrictionLabel, 0, 3); _panel.Controls.Add(_dynamicFrictionLabel, 0, 4); _panel.Controls.Add(_ambientTemperatureLabel, 0, 5); _panel.Controls.Add(_mechanicalEfficiencyLabel, 0, 6); _panel.Controls.Add(_coolingLabel, 0, 7); _panel.Controls.Add(_stackedAxisDescription, 0, 8); _panel.SetColumnSpan(_stackedAxisDescription, 3); _panel.Controls.Add(_stackedAxisLabel, 0, 9); _panel.Controls.Add(_stackedMassLabel, 0, 10); _panel.Controls.Add(_commentsLabel, 0, 11); _panel.Controls.Add(_outputs, 3, 2); _panel.Controls.Add(_totalSeqTimeLabel, 3, 3); _panel.Controls.Add(_maxLinearSpeedLabel, 3, 4); _panel.Controls.Add(_peakAccelerationLabel, 3, 5); _panel.Controls.Add(_peakForceLabel, 3, 6); _panel.Controls.Add(_totalRMSForceLabel, 3, 7); _panel.Controls.Add(_peakCurrentLabel, 3, 8); _panel.Controls.Add(_continuousCurrentLabel, 3, 9); //_panel.Controls.Add(_minBusVoltageLabel, 3, 9); _panel.Controls.Add(_finalCoilTemperatureLabel, 3, 10); _panel.Controls.Add(_sequenceName, 2, 0); _panel.SetColumnSpan(_sequenceName, 4); _panel.Controls.Add(_maxStaticFriction, 1, 3); _panel.Controls.Add(_dynamicFriction, 1, 4); _panel.Controls.Add(_ambientTemperature, 1, 5); _panel.Controls.Add(_mechanicalEfficiency, 1, 6); _panel.Controls.Add(_cooling, 1, 7); _panel.SetColumnSpan(_cooling, 2); _panel.Controls.Add(_stackedAxis, 1, 9); _panel.SetColumnSpan(_stackedAxis, 2); _panel.Controls.Add(_stackedMass, 1, 10); _panel.Controls.Add(_comments, 1, 11); _panel.SetRowSpan(_comments, 9); _panel.SetColumnSpan(_comments, 5); _panel.Controls.Add(_totalSeqTime, 4, 3); _panel.Controls.Add(_maxLinearSpeed, 4, 4); _panel.Controls.Add(_peakAcceleration, 4, 5); _panel.Controls.Add(_peakForce, 4, 6); _panel.Controls.Add(_totalRMSForce, 4, 7); _panel.Controls.Add(_peakCurrent, 4, 8); _panel.Controls.Add(_continuousCurrent, 4, 9); //_panel.Controls.Add(_minBusVoltage, 4, 9); _panel.Controls.Add(_finalCoilTemperature, 4, 10); _panel.Controls.Add(_maxStaticFrictionUnits, 2, 3); _panel.Controls.Add(_dynamicFrictionUnits, 2, 4); _panel.Controls.Add(_ambientTemperatureUnits, 2, 5); _panel.Controls.Add(_mechanicalEfficiencyUnits, 2, 6); _panel.Controls.Add(_stackedMassUnits, 2, 10); _panel.Controls.Add(_totalSeqTimeUnits, 5, 3); _panel.Controls.Add(_maxLinearSpeedUnits, 5, 4); _panel.Controls.Add(_peakAccelerationUnits, 5, 5); _panel.Controls.Add(_peakForceUnits, 5, 6); _panel.Controls.Add(_totalRMSForceUnits, 5, 7); _panel.Controls.Add(_peakCurrentUnits, 5, 8); _panel.Controls.Add(_continuousCurrentUnits, 5, 9); //_panel.Controls.Add(_minBusVoltageUnits, 5, 9); _panel.Controls.Add(_finalCoilTemperatureUnits, 5, 10); }
private void InitializeComponent() { ComponentResourceManager manager = new ComponentResourceManager(typeof(PasswordDialog)); this.chkShowPassword = new CheckBox(); this.txtPassword = new TextBoxEx(); this.lblPassword = new Label(); this.imgKeys = new PictureBox(); this.chkRememberPassword = new CheckBox(); Button button = new Button(); Button button2 = new Button(); TableLayoutPanel panel = new TableLayoutPanel(); TableLayoutPanel panel2 = new TableLayoutPanel(); Bevel bevel = new Bevel(); panel.SuspendLayout(); ((ISupportInitialize) this.imgKeys).BeginInit(); panel2.SuspendLayout(); base.SuspendLayout(); button.DialogResult = DialogResult.OK; manager.ApplyResources(button, "btnOk"); button.Name = "btnOk"; button.UseVisualStyleBackColor = true; button2.DialogResult = DialogResult.Cancel; manager.ApplyResources(button2, "btnCancel"); button2.Name = "btnCancel"; button2.UseVisualStyleBackColor = true; manager.ApplyResources(panel, "tlpBack"); panel.Controls.Add(this.chkShowPassword, 1, 2); panel.Controls.Add(this.txtPassword, 1, 1); panel.Controls.Add(this.lblPassword, 1, 0); panel.Controls.Add(this.imgKeys, 0, 0); panel.Controls.Add(this.chkRememberPassword, 1, 3); panel.Name = "tlpBack"; manager.ApplyResources(this.chkShowPassword, "chkShowPassword"); this.chkShowPassword.Name = "chkShowPassword"; this.chkShowPassword.UseVisualStyleBackColor = true; this.chkShowPassword.CheckedChanged += new EventHandler(this.chkShowPassword_CheckedChanged); manager.ApplyResources(this.txtPassword, "txtPassword"); this.txtPassword.Name = "txtPassword"; this.txtPassword.UseSystemPasswordChar = true; manager.ApplyResources(this.lblPassword, "lblPassword"); this.lblPassword.Name = "lblPassword"; manager.ApplyResources(this.imgKeys, "imgKeys"); this.imgKeys.Name = "imgKeys"; panel.SetRowSpan(this.imgKeys, 4); this.imgKeys.TabStop = false; manager.ApplyResources(this.chkRememberPassword, "chkRememberPassword"); this.chkRememberPassword.Checked = true; this.chkRememberPassword.CheckState = CheckState.Checked; this.chkRememberPassword.Name = "chkRememberPassword"; this.chkRememberPassword.UseVisualStyleBackColor = true; manager.ApplyResources(panel2, "tlpButtons"); panel2.Controls.Add(button, 1, 0); panel2.Controls.Add(button2, 2, 0); panel2.GrowStyle = TableLayoutPanelGrowStyle.FixedSize; panel2.Name = "tlpButtons"; manager.ApplyResources(bevel, "bvlButtons"); bevel.ForeColor = SystemColors.ControlDarkDark; bevel.Name = "bvlButtons"; bevel.Sides = Border3DSide.Top; bevel.Style = Border3DStyle.Flat; base.AcceptButton = button; manager.ApplyResources(this, "$this"); base.AutoScaleMode = AutoScaleMode.Font; base.CancelButton = button2; base.Controls.Add(panel2); base.Controls.Add(bevel); base.Controls.Add(panel); base.FormBorderStyle = FormBorderStyle.FixedDialog; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "PasswordDialog"; base.ShowInTaskbar = false; base.Shown += new EventHandler(this.PasswordDialog_Shown); base.FormClosed += new FormClosedEventHandler(this.PasswordDialog_FormClosed); panel.ResumeLayout(false); panel.PerformLayout(); ((ISupportInitialize) this.imgKeys).EndInit(); panel2.ResumeLayout(false); base.ResumeLayout(false); base.PerformLayout(); }
private void InitializeComponent() { ComponentResourceManager manager = new ComponentResourceManager(typeof(BasicLoginDialog)); this.btnCancel = new Button(); this.chkShowPassword = new CheckBox(); this.cmbUserName = new ComboBox(); this.txtPassword = new TextBoxEx(); this.btnOk = new Button(); this.imgKeys = new PictureBox(); this.lblMessage = new Label(); Label label = new Label(); Label label2 = new Label(); TableLayoutPanel panel = new TableLayoutPanel(); ((ISupportInitialize) this.imgKeys).BeginInit(); panel.SuspendLayout(); base.SuspendLayout(); manager.ApplyResources(label, "lblUserName"); label.MinimumSize = new Size(80, 0); label.Name = "lblUserName"; manager.ApplyResources(label2, "lblPassword"); label2.MinimumSize = new Size(80, 0); label2.Name = "lblPassword"; manager.ApplyResources(this.btnCancel, "btnCancel"); this.btnCancel.DialogResult = DialogResult.Cancel; this.btnCancel.Name = "btnCancel"; this.btnCancel.UseVisualStyleBackColor = true; manager.ApplyResources(this.chkShowPassword, "chkShowPassword"); this.chkShowPassword.Checked = Settings.Default.RunAsShowPassword; panel.SetColumnSpan(this.chkShowPassword, 3); this.chkShowPassword.DataBindings.Add(new Binding("Checked", Settings.Default, "RunAsShowPassword", true, DataSourceUpdateMode.OnPropertyChanged)); this.chkShowPassword.Name = "chkShowPassword"; this.chkShowPassword.UseVisualStyleBackColor = true; this.chkShowPassword.CheckedChanged += new EventHandler(this.chkShowPassword_CheckedChanged); panel.SetColumnSpan(this.cmbUserName, 3); manager.ApplyResources(this.cmbUserName, "cmbUserName"); this.cmbUserName.FormattingEnabled = true; this.cmbUserName.Name = "cmbUserName"; panel.SetColumnSpan(this.txtPassword, 3); manager.ApplyResources(this.txtPassword, "txtPassword"); this.txtPassword.Name = "txtPassword"; this.txtPassword.UseSystemPasswordChar = true; manager.ApplyResources(this.btnOk, "btnOk"); this.btnOk.DialogResult = DialogResult.OK; this.btnOk.Name = "btnOk"; this.btnOk.UseVisualStyleBackColor = true; manager.ApplyResources(this.imgKeys, "imgKeys"); this.imgKeys.Name = "imgKeys"; panel.SetRowSpan(this.imgKeys, 5); this.imgKeys.TabStop = false; manager.ApplyResources(this.lblMessage, "lblMessage"); panel.SetColumnSpan(this.lblMessage, 4); this.lblMessage.MaximumSize = new Size(0x132, 0); this.lblMessage.Name = "lblMessage"; manager.ApplyResources(panel, "tlpBack"); panel.Controls.Add(label2, 1, 2); panel.Controls.Add(this.chkShowPassword, 2, 3); panel.Controls.Add(this.lblMessage, 1, 0); panel.Controls.Add(this.btnCancel, 4, 4); panel.Controls.Add(this.txtPassword, 2, 2); panel.Controls.Add(this.cmbUserName, 2, 1); panel.Controls.Add(this.imgKeys, 0, 0); panel.Controls.Add(this.btnOk, 3, 4); panel.Controls.Add(label, 1, 1); panel.Name = "tlpBack"; base.AcceptButton = this.btnOk; manager.ApplyResources(this, "$this"); base.AutoScaleMode = AutoScaleMode.Font; base.CancelButton = this.btnCancel; base.Controls.Add(panel); base.FormBorderStyle = FormBorderStyle.FixedDialog; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "BasicLoginDialog"; base.ShowInTaskbar = false; base.Shown += new EventHandler(this.BasicLoginDialog_Shown); base.FormClosed += new FormClosedEventHandler(this.BasicLoginDialog_FormClosed); ((ISupportInitialize) this.imgKeys).EndInit(); panel.ResumeLayout(false); panel.PerformLayout(); base.ResumeLayout(false); base.PerformLayout(); }
public void TestCellPositioning9 () { // Row span TableLayoutPanel p = new TableLayoutPanel (); Control c1 = new Button (); Control c2 = new Button (); Control c3 = new Button (); p.ColumnCount = 2; p.RowCount = 2; p.SetRowSpan (c1, 2); p.Controls.Add (c1); p.Controls.Add (c2); p.Controls.Add (c3); Assert.AreEqual (new TableLayoutPanelCellPosition (0, 0), p.GetPositionFromControl (c1), "C1"); Assert.AreEqual (new TableLayoutPanelCellPosition (1, 0), p.GetPositionFromControl (c2), "C2"); Assert.AreEqual (new TableLayoutPanelCellPosition (1, 1), p.GetPositionFromControl (c3), "C3"); }
internal static void GetData(System.Windows.Forms.Panel pnlResult, int dataCount, int backCount, DataType.Data ApproximateDataType, ref System.Windows.Forms.TableLayoutPanel tableLayoutPanel) { if (dataCount < 1) { return; } //绘制标题记录项 pnlResult.Controls.Clear(); TextBox txtTitle = new TextBox(); txtTitle.Location = new Point(45, 45); txtTitle.BorderStyle = BorderStyle.None; txtTitle.Width = 606; txtTitle.Text = "水平角观测记录"; txtTitle.TextAlign = HorizontalAlignment.Center; txtTitle.Font = new Font("宋体", 12, FontStyle.Bold); TextBox txtProjectName = new TextBox(); txtProjectName.Location = new Point(45, 76); txtProjectName.BorderStyle = BorderStyle.None; txtProjectName.Width = 194; txtProjectName.Text = "工程名称:"; TextBox txtInstrument = new TextBox(); txtInstrument.Location = new Point(246, 76); txtInstrument.BorderStyle = BorderStyle.None; txtInstrument.Width = 194; txtInstrument.Text = "仪器:"; TextBox txtWeather = new TextBox(); txtWeather.Location = new Point(447, 76); txtWeather.BorderStyle = BorderStyle.None; txtWeather.Width = 194; txtWeather.Text = "天气:"; TextBox txtObserver = new TextBox(); txtObserver.Location = new Point(45, 97); txtObserver.BorderStyle = BorderStyle.None; txtObserver.Width = 194; txtObserver.Text = "观测者:"; TextBox txtRecorder = new TextBox(); txtRecorder.Location = new Point(246, 97); txtRecorder.BorderStyle = BorderStyle.None; txtRecorder.Width = 194; txtRecorder.Text = "记录者:"; TextBox txtDate = new TextBox(); txtDate.Location = new Point(447, 97); txtDate.BorderStyle = BorderStyle.None; txtDate.Width = 194; txtDate.Text = "日期:" + DateTime.Now.ToString("yyyy-MM-dd"); //测站点 for (int i = 2; i < tableLayoutPanel.RowCount - 1; i += (2 * backCount)) { TextBox txtBoxCol0 = new TextBox(); txtBoxCol0.Multiline = true; txtBoxCol0.Margin = new Padding(0); txtBoxCol0.Name = "txtBoxCol1" + i; txtBoxCol0.Width = 56; txtBoxCol0.Height = backCount * 44; txtBoxCol0.TextAlign = HorizontalAlignment.Center; txtBoxCol0.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol0, 0, i); Control[] ctrlTxtBoxCol0 = tableLayoutPanel.Controls.Find(txtBoxCol0.Name, false); tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol0[0], backCount * 2); } //照准点 for (int i = 2; i < tableLayoutPanel.RowCount - 1; i++) { TextBox txtBoxCol = new TextBox(); txtBoxCol.Margin = new Padding(0); txtBoxCol.Width = 56; txtBoxCol.Height = 21; txtBoxCol.TextAlign = HorizontalAlignment.Center; txtBoxCol.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol, 1, i); } //盘左 for (int i = 2; i < tableLayoutPanel.RowCount - 1; i++) { TextBox txtBoxCol = new TextBox(); txtBoxCol.Margin = new Padding(0); txtBoxCol.Width = 108; txtBoxCol.Height = 21; txtBoxCol.TextAlign = HorizontalAlignment.Center; txtBoxCol.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol, 2, i); } //盘右 for (int i = 2; i < tableLayoutPanel.RowCount - 1; i++) { TextBox txtBoxCol = new TextBox(); txtBoxCol.Margin = new Padding(0); txtBoxCol.Width = 108; txtBoxCol.Height = 21; txtBoxCol.TextAlign = HorizontalAlignment.Center; txtBoxCol.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol, 3, i); } //根据数据类型决定已知点的个数并生成相应的单元格 if (ApproximateDataType == DataType.Data.ConnectingTraverse)//闭附和导线 { TextBox txtBoxCol6f = new TextBox(); txtBoxCol6f.Name = "txtBoxCol6f"; txtBoxCol6f.Multiline = true; txtBoxCol6f.Margin = new Padding(0); txtBoxCol6f.Width = 108; txtBoxCol6f.Height = backCount * 21; txtBoxCol6f.TextAlign = HorizontalAlignment.Center; txtBoxCol6f.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol6f, 6, 2); Control[] ctrlTxtBxoCol6f = tableLayoutPanel.Controls.Find(txtBoxCol6f.Name, false); tableLayoutPanel.SetRowSpan(ctrlTxtBxoCol6f[0], backCount); TextBox txtBoxCol6l = new TextBox(); txtBoxCol6l.Name = "txtBoxCol6l"; txtBoxCol6l.Multiline = true; txtBoxCol6l.Margin = new Padding(0); txtBoxCol6l.Width = 108; txtBoxCol6l.Height = backCount * 44; txtBoxCol6l.TextAlign = HorizontalAlignment.Center; txtBoxCol6l.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol6l, 6, tableLayoutPanel.RowCount - 1 - backCount * 2); Control[] ctrlTxtBoxCol6l = tableLayoutPanel.Controls.Find(txtBoxCol6l.Name, false); tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol6l[0], backCount * 2); } else if (ApproximateDataType == DataType.Data.OpenTraverse)//支导线 { TextBox txtBoxCol6 = new TextBox(); txtBoxCol6.Name = "txtBoxCol6"; txtBoxCol6.Multiline = true; txtBoxCol6.Margin = new Padding(0); txtBoxCol6.Width = 108; txtBoxCol6.Height = 22 * backCount; txtBoxCol6.TextAlign = HorizontalAlignment.Center; txtBoxCol6.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol6, 6, 2); tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 21f)); Control[] ctrlTxtBoxCol6 = tableLayoutPanel.Controls.Find(txtBoxCol6.Name, false); tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol6[0], backCount); } //表末尾备注 TextBox txtCalculate = new TextBox(); txtCalculate.Location = new Point(48, tableLayoutPanel.Height + 125); txtCalculate.Width = 195; txtCalculate.Height = 21; txtCalculate.Text = "计算者:"; txtCalculate.BorderStyle = BorderStyle.None; pnlResult.Controls.Add(txtCalculate); TextBox txtAssessment = new TextBox(); txtAssessment.Location = new Point(246, tableLayoutPanel.Height + 125); txtAssessment.Width = 195; txtAssessment.Height = 21; txtAssessment.Text = "审核者:"; txtAssessment.BorderStyle = BorderStyle.None; pnlResult.Controls.Add(txtAssessment); TextBox txtDataEnd = new TextBox(); txtDataEnd.Location = new Point(442, tableLayoutPanel.Height + 125); txtDataEnd.Width = 195; txtDataEnd.Height = 21; txtDataEnd.Text = "日期:" + DateTime.Now.ToString("yyyy-MM-dd"); txtDataEnd.BorderStyle = BorderStyle.None; pnlResult.Controls.Add(txtDataEnd); Label lbl = new Label(); lbl.Location = new Point(45, 171 + tableLayoutPanel.Height); //将控件添加到panel pnlResult.Controls.Add(txtTitle); pnlResult.Controls.Add(txtProjectName); pnlResult.Controls.Add(txtInstrument); pnlResult.Controls.Add(txtWeather); pnlResult.Controls.Add(txtObserver); pnlResult.Controls.Add(txtRecorder); pnlResult.Controls.Add(txtDate); pnlResult.Controls.Add(tableLayoutPanel); pnlResult.Controls.Add(lbl); }
public void TestCellPositioning18 () { // A control with both rowspan and columnspan > 1 was getting // other controls put into its extent (i.e. c3 was ending up // at (1,1) instead of (2,1). TableLayoutPanel p = new TableLayoutPanel (); Control c1 = new Button (); Control c2 = new Button (); Control c3 = new Button (); Control c4 = new Button (); p.ColumnCount = 3; p.RowCount = 4; p.SetRowSpan (c1, 2); p.SetColumnSpan (c1, 2); p.SetCellPosition (c1, new TableLayoutPanelCellPosition (0, 0)); p.Controls.Add (c1); p.Controls.Add (c2); p.Controls.Add (c3); p.Controls.Add (c4); Assert.AreEqual (new TableLayoutPanelCellPosition (0, 0), p.GetPositionFromControl (c1), "C1"); Assert.AreEqual (new TableLayoutPanelCellPosition (2, 0), p.GetPositionFromControl (c2), "C2"); Assert.AreEqual (new TableLayoutPanelCellPosition (2, 1), p.GetPositionFromControl (c3), "C3"); Assert.AreEqual (new TableLayoutPanelCellPosition (0, 2), p.GetPositionFromControl (c4), "C4"); }
private void InitializeComponent() { this.components = new Container(); ComponentResourceManager manager = new ComponentResourceManager(typeof(HighlightersOptionControl)); this.tsView = new ToolStrip(); this.tsbChangeView = new ToolStripButton(); this.trkBlendLevel = new TrackBar(); this.filterControlComplex = new ComplexFilterControl(); this.pnlIcon = new PanelEx(); this.btnBlendColor = new ColorButton(); this.cmbHighlighters = new TemplateComboBox(); this.btnDeleteHighlighter = new Button(); this.btnBrowseIcon = new Button(); this.btnSaveHighlighter = new Button(); this.cmbIconLocation = new ComboBox(); this.chkItemIcon = new CheckBox(); this.chkAlphaBlendIcon = new CheckBox(); this.btnItemForeColor = new ColorButton(); this.imageList = new ImageList(this.components); this.toolTipLevel = new ToolTip(this.components); this.BrowseIconDialog = new OpenFileDialog(); Label label = new Label(); TableLayoutPanel panel = new TableLayoutPanel(); Label control = new Label(); panel.SuspendLayout(); this.tsView.SuspendLayout(); this.trkBlendLevel.BeginInit(); base.SuspendLayout(); manager.ApplyResources(label, "lblItemForeColor"); label.Name = "lblItemForeColor"; manager.ApplyResources(panel, "tlpBack"); panel.Controls.Add(control, 0, 0); panel.Controls.Add(this.tsView, 0, 5); panel.Controls.Add(this.trkBlendLevel, 2, 3); panel.Controls.Add(this.filterControlComplex, 0, 4); panel.Controls.Add(this.pnlIcon, 4, 2); panel.Controls.Add(this.btnBlendColor, 1, 3); panel.Controls.Add(this.cmbHighlighters, 1, 0); panel.Controls.Add(this.btnBrowseIcon, 3, 2); panel.Controls.Add(this.btnSaveHighlighter, 3, 0); panel.Controls.Add(this.cmbIconLocation, 1, 2); panel.Controls.Add(this.btnDeleteHighlighter, 4, 0); panel.Controls.Add(this.chkItemIcon, 0, 2); panel.Controls.Add(label, 0, 1); panel.Controls.Add(this.chkAlphaBlendIcon, 0, 3); panel.Controls.Add(this.btnItemForeColor, 1, 1); panel.Name = "tlpBack"; manager.ApplyResources(control, "lblStoredHighlighter"); control.Name = "lblStoredHighlighter"; this.tsView.BackColor = Color.Transparent; panel.SetColumnSpan(this.tsView, 5); this.tsView.GripStyle = ToolStripGripStyle.Hidden; this.tsView.Items.AddRange(new ToolStripItem[] { this.tsbChangeView }); manager.ApplyResources(this.tsView, "tsView"); this.tsView.Name = "tsView"; this.tsView.TabStop = true; this.tsbChangeView.DisplayStyle = ToolStripItemDisplayStyle.Image; this.tsbChangeView.Image = Resources.ShowDetail; this.tsbChangeView.Name = "tsbChangeView"; manager.ApplyResources(this.tsbChangeView, "tsbChangeView"); this.tsbChangeView.Click += new EventHandler(this.tsbChangeView_Click); this.tsbChangeView.Paint += new PaintEventHandler(this.tsbChangeView_Paint); manager.ApplyResources(this.trkBlendLevel, "trkBlendLevel"); panel.SetColumnSpan(this.trkBlendLevel, 2); this.trkBlendLevel.Maximum = 100; this.trkBlendLevel.Name = "trkBlendLevel"; this.trkBlendLevel.Value = 50; this.trkBlendLevel.Scroll += new EventHandler(this.trkBlendLevel_Scroll); this.trkBlendLevel.ValueChanged += new EventHandler(this.UpdateButtons); this.trkBlendLevel.Enter += new EventHandler(this.trkBlendLevel_Enter); this.trkBlendLevel.Leave += new EventHandler(this.trkBlendLevel_Leave); this.trkBlendLevel.MouseDown += new MouseEventHandler(this.trkBlendLevel_MouseDown); this.trkBlendLevel.MouseUp += new MouseEventHandler(this.trkBlendLevel_MouseUp); this.filterControlComplex.AdvancedViewFilters = ViewFilters.Advanced | ViewFilters.Attributes | ViewFilters.ExcludeMask | ViewFilters.IncludeMask; manager.ApplyResources(this.filterControlComplex, "filterControlComplex"); panel.SetColumnSpan(this.filterControlComplex, 5); this.filterControlComplex.HideViewFilters = ViewFilters.Folder | ViewFilters.Content; this.filterControlComplex.MinimumSize = new Size(0x1c4, 0); this.filterControlComplex.Name = "filterControlComplex"; this.filterControlComplex.View = ComplexFilterView.Advanced; this.filterControlComplex.ViewChanged += new EventHandler(this.filterControlComplex_ViewChanged); this.filterControlComplex.FilterChanged += new EventHandler(this.UpdateButtons); this.pnlIcon.BorderColor = Color.FromArgb(0xab, 0xad, 0xb3); manager.ApplyResources(this.pnlIcon, "pnlIcon"); this.pnlIcon.Name = "pnlIcon"; panel.SetRowSpan(this.pnlIcon, 2); this.pnlIcon.Paint += new PaintEventHandler(this.pnlIcon_Paint); manager.ApplyResources(this.btnBlendColor, "btnBlendColor"); this.btnBlendColor.Name = "btnBlendColor"; this.btnBlendColor.UseVisualStyleBackColor = true; this.btnBlendColor.ColorChanged += new EventHandler(this.UpdateButtons); panel.SetColumnSpan(this.cmbHighlighters, 2); this.cmbHighlighters.DeleteButton = this.btnDeleteHighlighter; manager.ApplyResources(this.cmbHighlighters, "cmbHighlighters"); this.cmbHighlighters.FormattingEnabled = true; this.cmbHighlighters.Name = "cmbHighlighters"; this.cmbHighlighters.SelectionChangeCommitted += new EventHandler(this.cmbHighlighters_SelectionChangeCommitted); this.cmbHighlighters.TextUpdate += new EventHandler(this.UpdateButtons); manager.ApplyResources(this.btnDeleteHighlighter, "btnDeleteHighlighter"); this.btnDeleteHighlighter.Name = "btnDeleteHighlighter"; this.btnDeleteHighlighter.UseVisualStyleBackColor = true; manager.ApplyResources(this.btnBrowseIcon, "btnBrowseIcon"); this.btnBrowseIcon.Name = "btnBrowseIcon"; this.btnBrowseIcon.UseVisualStyleBackColor = true; this.btnBrowseIcon.Click += new EventHandler(this.btnBrowseIcon_Click); manager.ApplyResources(this.btnSaveHighlighter, "btnSaveHighlighter"); this.btnSaveHighlighter.Name = "btnSaveHighlighter"; this.btnSaveHighlighter.UseVisualStyleBackColor = true; this.btnSaveHighlighter.Click += new EventHandler(this.btnSaveHighlighter_Click); panel.SetColumnSpan(this.cmbIconLocation, 2); manager.ApplyResources(this.cmbIconLocation, "cmbIconLocation"); this.cmbIconLocation.FormattingEnabled = true; this.cmbIconLocation.Name = "cmbIconLocation"; this.cmbIconLocation.Enter += new EventHandler(this.cmbIconLocation_Enter); this.cmbIconLocation.Validated += new EventHandler(this.cmbIconLocation_Validated); manager.ApplyResources(this.chkItemIcon, "chkItemIcon"); this.chkItemIcon.Name = "chkItemIcon"; this.chkItemIcon.UseVisualStyleBackColor = true; this.chkItemIcon.CheckedChanged += new EventHandler(this.chkItemIcon_CheckedChanged); this.chkItemIcon.Click += new EventHandler(this.UpdateButtons); manager.ApplyResources(this.chkAlphaBlendIcon, "chkAlphaBlendIcon"); this.chkAlphaBlendIcon.Name = "chkAlphaBlendIcon"; this.chkAlphaBlendIcon.UseVisualStyleBackColor = true; this.chkAlphaBlendIcon.CheckedChanged += new EventHandler(this.chkAlphaBlendIcon_CheckedChanged); this.chkAlphaBlendIcon.Click += new EventHandler(this.UpdateButtons); manager.ApplyResources(this.btnItemForeColor, "btnItemForeColor"); this.btnItemForeColor.Name = "btnItemForeColor"; this.btnItemForeColor.UseVisualStyleBackColor = true; this.btnItemForeColor.ColorChanged += new EventHandler(this.UpdateButtons); this.imageList.ColorDepth = ColorDepth.Depth8Bit; manager.ApplyResources(this.imageList, "imageList"); this.imageList.TransparentColor = Color.Transparent; this.BrowseIconDialog.AddExtension = false; manager.ApplyResources(this.BrowseIconDialog, "BrowseIconDialog"); manager.ApplyResources(this, "$this"); base.AutoScaleMode = AutoScaleMode.Font; base.Controls.Add(panel); this.MinimumSize = new Size(0x1c4, 0); base.Name = "HighlightersOptionControl"; panel.ResumeLayout(false); panel.PerformLayout(); this.tsView.ResumeLayout(false); this.tsView.PerformLayout(); this.trkBlendLevel.EndInit(); base.ResumeLayout(false); base.PerformLayout(); }
private void Initialize() { _panel = new TableLayoutPanel(); _panel.Dock = DockStyle.Fill; _panel.RowCount = 20; _panel.ColumnCount = 6; _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.RowStyles.Add(new RowStyle(SizeType.Percent, 0.05F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0F / 6.0F)); _unitLists = new Dictionary<string, string[]>(); _unitLists.Add("length", new string[] { "m", "mm", "cm", "in", "ft" }); _unitLists.Add("mass", new string[] { "kg", "g", "lb" }); _unitLists.Add("time", new string[] { "s", "ms", "min" }); _unitLists.Add("angle", new string[] { "rad", "deg", "rev" }); _unitLists.Add("percent", new string[] { "fraction", "%" }); _unitLists.Add("force", new string[] { "N", "lb" }); _unitLists.Add("velocity", new string[] { "m/s", "mm/s", "m/min", "in/s", "in/min" }); _unitLists.Add("acceleration", new string[] { "m/s^2", "mm/s^2", "m/min^2", "in/s^2", "in/min^2", "g" }); _unitLists.Add("temperature", new string[] { "\x00B0C", "\x00B0F", "K" }); _profileNameLabel = addLabel("Linear Movement Profile"); _profileNameLabel.Font = new Font("Tahoma", 14, FontStyle.Bold); _accelerationTypeLabel = addLabel("Acceleration Type"); _inputs = addLabel("Inputs"); _inputs.Font = new Font("Tahoma", 10, FontStyle.Bold); _outputs = addLabel("Outputs"); _outputs.Font = new Font("Tahoma", 10, FontStyle.Bold); _lengthOfTravelLabel = addLabel("Length of Travel"); _massOfLoadLabel = addLabel("Mass of Load"); _accelerationTimeLabel = addLabel("Accel. Time"); _traverseTimeLabel = addLabel("Traverse Time"); _decelerationTimeLabel = addLabel("Decel. Time"); _dwellTimeLabel = addLabel("Dwell Time"); _inclineAngleLabel = addLabel("Incline Angle"); _thrustForceLabel = addLabel("Thrust Force"); _maxStaticFrictionLabel = addLabel("Max Static Friction"); _dynamicFrictionLabel = addLabel("Dynamic Friction"); _ambientTemperatureLabel = addLabel("Ambient Temp."); _mechanicalEfficiencyLabel = addLabel("Mech. Efficiency"); _coolingLabel = addLabel("Cooling"); _totalMoveTimeLabel = addLabel("Total Move Time"); _dutyCycleLabel = addLabel("Duty Cycle"); _maxLinearSpeedLabel = addLabel("Max Linear Speed"); _peakAccelerationLabel = addLabel("Peak Acceleration"); _peakAccelerationForceLabel = addLabel("Peak Accel. Force"); _peakTraverseForceLabel = addLabel("Peak Trav. Force"); _peaDecelerationForceLabel = addLabel("Peak Decel. Force"); _peakDwellForceLabel = addLabel("Peak Dwell Force"); _peakForceLabel = addLabel("Peak Force"); _totalRMSForceLabel = addLabel("RMS Force"); _peakCurrentLabel = addLabel("Peak Current"); _continuousCurrentLabel = addLabel("RMS Current"); _minBusVoltageLabel = addLabel("Min Bus Voltage"); _finalCoilTemperatureLabel = addLabel("Final Coil Temp."); _totalRMSForceForEntireSequenceLabel = addLabel("Total RMS Force for Entire Sequence"); _commentsLabel = addLabel("Comments"); _profileName = addTextBox(false); _lengthOfTravel = addTextBox(true); _massOfLoad = addTextBox(false); _accelerationTime = addTextBox(true); _traverseTime = addTextBox(true); _decelerationTime = addTextBox(true); _dwellTime = addTextBox(true); _inclineAngle = addTextBox(false); _thrustForce = addTextBox(false); _maxStaticFriction = addTextBox(true); _dynamicFriction = addTextBox(true); _ambientTemperature = addTextBox(true); _mechanicalEfficiency = addTextBox(true); _cooling = addTextBox(true); _totalMoveTime = addTextBox(true); //_dutyCycle = addTextBox(false); _dutyCycle = addTextBox(true); _maxLinearSpeed = addTextBox(true); _peakAcceleration = addTextBox(true); _peakAccelerationForce = addTextBox(true); _peakTraverseForce = addTextBox(true); _peaDecelerationForce = addTextBox(true); _peakDwellForce = addTextBox(true); _peakForce = addTextBox(true); _totalRMSForce = addTextBox(true); _peakCurrent = addTextBox(true); _continuousCurrent = addTextBox(true); _minBusVoltage = addTextBox(true); _finalCoilTemperature = addTextBox(true); _totalRMSForceForEntireSequence = addTextBox(true); _comments = addTextBox(false); _comments.Name = "_comments"; _comments.Multiline = true; _comments.Text = _project.ProfileComments; _comments.TextAlign = HorizontalAlignment.Left; _profileName.Name = "_profileName"; _profileName.Text = _project.ProfileName; _profileNameString = _profileName.Text; _profileName.TextAlign = HorizontalAlignment.Left; _project.Load = new Load(0.25, 0); _massOfLoad.Name = "_massOfLoad"; _inclineAngle.Name = "_inclineAngle"; _thrustForce.Name = "_thrustForce"; _massOfLoad.Text = "0.25"; _inclineAngle.Text = "0"; _thrustForce.Text = "0"; _maxStaticFriction.Text = _project.Environment.StaticFriction.ToString(); _dynamicFriction.Text = _project.Environment.DynamicFriction.ToString(); _ambientTemperature.Text = _project.Environment.AmbientTemp.ToString(); _mechanicalEfficiency.Text = _project.Environment.MechEfficiency.ToString(); _cooling.Text = _project.Environment.Cooling; /* _accelerationType = new ComboBox(); _accelerationType.Items.Add(string.Format("Constant")); _accelerationType.Items.Add(string.Format("Triangular")); _accelerationType.Items.Add(string.Format("Sinusoidal")); _accelerationType.Width = 200; _accelerationType.Dock = DockStyle.Right; _accelerationType.Anchor = AnchorStyles.Top | AnchorStyles.Right; _accelerationType.DropDownStyle = ComboBoxStyle.DropDownList; _accelerationType.SelectedItem = _accelerationType.Items[0]; */ _lengthOfTravelUnits = fillComboBox("length", 0); _massOfLoadUnits = fillComboBox("mass", 0); _accelerationTimeUnits = fillComboBox("time", 1); _traverseTimeUnits = fillComboBox("time", 1); _decelerationTimeUnits = fillComboBox("time", 1); _dwellTimeUnits = fillComboBox("time", 1); _inclineAngleUnits = fillComboBox("angle", 1); _thrustForceUnits = fillComboBox("force", 0); _maxStaticFrictionUnits = addLabel("N"); _dynamicFrictionUnits = addLabel("N/(m/s)"); _ambientTemperatureUnits = addLabel("\x00B0C"); _mechanicalEfficiencyUnits = addLabel("%"); _totalMoveTimeUnits = fillComboBox("time", 0); _dutyCycleUnits = fillComboBox("percent", 1); _maxLinearSpeedUnits = fillComboBox("velocity", 0); _peakAccelerationUnits = fillComboBox("acceleration", 0); _peakAccelerationForceUnits = fillComboBox("force", 0); _peakTraverseForceUnits = fillComboBox("force", 0); _peaDecelerationForceUnits = fillComboBox("force", 0); _peakDwellForceUnits = fillComboBox("force", 0); _peakForceUnits = fillComboBox("force", 0); _totalRMSForceUnits = fillComboBox("force", 0); _peakCurrentUnits = addLabel("A"); _continuousCurrentUnits = addLabel("A"); _minBusVoltageUnits = addLabel("V"); _finalCoilTemperatureUnits = fillComboBox("temperature", 0); _totalRMSForceForEntireSequenceUnits = fillComboBox("force", 0); _solve = new Button(); _solve.Text = "Solve"; _solve.Anchor = AnchorStyles.Top | AnchorStyles.Left; _solve.Click += new EventHandler(_solve_Click); _solve.Padding = new Padding(10); _solve.Font = new Font("Tahoma", 14, FontStyle.Bold); _solve.Dock = DockStyle.Fill; _panel.Controls.Add(_profileNameLabel, 0, 0); _panel.SetColumnSpan(_profileNameLabel, 2); //_panel.Controls.Add(_accelerationTypeLabel, 0, 1); _panel.Controls.Add(_solve, 2, 1); _panel.SetColumnSpan(_solve, 2); _panel.SetRowSpan(_solve, 2); _panel.Controls.Add(_inputs, 0, 3); _panel.Controls.Add(_lengthOfTravelLabel, 0, 4); _panel.Controls.Add(_massOfLoadLabel, 0, 5); //_panel.Controls.Add(_accelerationTimeLabel, 0, 6); //_panel.Controls.Add(_traverseTimeLabel, 0, 7); //_panel.Controls.Add(_decelerationTimeLabel, 0, 8); //_panel.Controls.Add(_dwellTimeLabel, 0, 9); _panel.Controls.Add(_inclineAngleLabel, 0, 6); _panel.Controls.Add(_thrustForceLabel, 0, 7); _panel.Controls.Add(_maxStaticFrictionLabel, 0, 8); _panel.Controls.Add(_dynamicFrictionLabel, 0, 9); _panel.Controls.Add(_ambientTemperatureLabel, 0, 10); _panel.Controls.Add(_mechanicalEfficiencyLabel, 0, 11); _panel.Controls.Add(_coolingLabel, 0, 12); _panel.Controls.Add(_commentsLabel, 0, 14); _panel.Controls.Add(_outputs, 3, 3); _panel.Controls.Add(_totalMoveTimeLabel, 3, 4); _panel.Controls.Add(_dutyCycleLabel, 3, 5); _panel.Controls.Add(_maxLinearSpeedLabel, 3, 6); _panel.Controls.Add(_peakAccelerationLabel, 3, 7); //_panel.Controls.Add(_peakAccelerationForceLabel, 3, 8); //_panel.Controls.Add(_peakTraverseForceLabel, 3, 9); //_panel.Controls.Add(_peaDecelerationForceLabel, 3, 10); //_panel.Controls.Add(_peakDwellForceLabel, 3, 11); _panel.Controls.Add(_peakForceLabel, 3, 8); _panel.Controls.Add(_totalRMSForceLabel, 3, 9); _panel.Controls.Add(_peakCurrentLabel, 3, 10); _panel.Controls.Add(_continuousCurrentLabel, 3, 11); //_panel.Controls.Add(_minBusVoltageLabel, 3, 11); _panel.Controls.Add(_finalCoilTemperatureLabel, 3, 12); _panel.Controls.Add(_totalRMSForceForEntireSequenceLabel, 2, 13); _panel.SetColumnSpan(_totalRMSForceForEntireSequenceLabel, 2); _panel.Controls.Add(_profileName, 2, 0); _panel.SetColumnSpan(_profileName, 4); _panel.Controls.Add(_lengthOfTravel, 1, 4); _panel.Controls.Add(_massOfLoad, 1, 5); //_panel.Controls.Add(_accelerationTime, 1, 6); //_panel.Controls.Add(_traverseTime, 1, 7); //_panel.Controls.Add(_decelerationTime, 1, 8); //_panel.Controls.Add(_dwellTime, 1, 9); _panel.Controls.Add(_inclineAngle, 1, 6); _panel.Controls.Add(_thrustForce, 1, 7); _panel.Controls.Add(_maxStaticFriction, 1, 8); _panel.Controls.Add(_dynamicFriction, 1, 9); _panel.Controls.Add(_ambientTemperature, 1, 10); _panel.Controls.Add(_mechanicalEfficiency, 1, 11); _panel.Controls.Add(_cooling, 1, 12); _panel.Controls.Add(_comments, 1, 14); _panel.SetRowSpan(_comments, 6); _panel.SetColumnSpan(_comments, 5); _panel.Controls.Add(_totalMoveTime, 4, 4); _panel.Controls.Add(_dutyCycle, 4, 5); _panel.Controls.Add(_maxLinearSpeed, 4, 6); _panel.Controls.Add(_peakAcceleration, 4, 7); //_panel.Controls.Add(_peakAccelerationForce, 4, 8); //_panel.Controls.Add(_peakTraverseForce, 4, 9); //_panel.Controls.Add(_peaDecelerationForce, 4, 10); //_panel.Controls.Add(_peakDwellForce, 4, 11); _panel.Controls.Add(_peakForce, 4, 8); _panel.Controls.Add(_totalRMSForce, 4, 9); _panel.Controls.Add(_peakCurrent, 4, 10); _panel.Controls.Add(_continuousCurrent, 4, 11); //_panel.Controls.Add(_minBusVoltage, 4, 11); _panel.Controls.Add(_finalCoilTemperature, 4, 12); _panel.Controls.Add(_totalRMSForceForEntireSequence, 4, 13); //_panel.Controls.Add(_accelerationType, 1, 1); //_panel.SetColumnSpan(_accelerationType, 1); _panel.Controls.Add(_lengthOfTravelUnits, 2, 4); _panel.Controls.Add(_massOfLoadUnits, 2, 5); //_panel.Controls.Add(_accelerationTimeUnits, 2, 6); //_panel.Controls.Add(_traverseTimeUnits, 2, 7); //_panel.Controls.Add(_decelerationTimeUnits, 2, 8); //_panel.Controls.Add(_dwellTimeUnits, 2, 9); _panel.Controls.Add(_inclineAngleUnits, 2, 6); _panel.Controls.Add(_thrustForceUnits, 2, 7); _panel.Controls.Add(_maxStaticFrictionUnits, 2, 8); _panel.Controls.Add(_dynamicFrictionUnits, 2, 9); _panel.Controls.Add(_ambientTemperatureUnits, 2, 10); _panel.Controls.Add(_mechanicalEfficiencyUnits, 2, 11); _panel.Controls.Add(_totalMoveTimeUnits, 5, 4); _panel.Controls.Add(_dutyCycleUnits, 5, 5); _panel.Controls.Add(_maxLinearSpeedUnits, 5, 6); _panel.Controls.Add(_peakAccelerationUnits, 5, 7); //_panel.Controls.Add(_peakAccelerationForceUnits, 5, 8); //_panel.Controls.Add(_peakTraverseForceUnits, 5, 9); //_panel.Controls.Add(_peaDecelerationForceUnits, 5, 10); //_panel.Controls.Add(_peakDwellForceUnits, 5, 11); _panel.Controls.Add(_peakDwellForceUnits, 5, 8); _panel.Controls.Add(_totalRMSForceUnits, 5, 9); _panel.Controls.Add(_peakCurrentUnits, 5, 10); _panel.Controls.Add(_continuousCurrentUnits, 5, 11); //_panel.Controls.Add(_minBusVoltageUnits, 5, 11); _panel.Controls.Add(_finalCoilTemperatureUnits, 5, 12); _panel.Controls.Add(_totalRMSForceForEntireSequenceUnits, 5, 13); }
internal static void GetData(string filePath, int backCount, System.Windows.Forms.TableLayoutPanel tableLayoutPanel, ref List <string> col0, ref List <string> col1, ref List <string> col2, ref List <string> col3, ref List <string> col4, ref List <string> col5, ref List <string> col6) { string[] strCol0; string[] strCol1; string[] strCol2; string[] strCol3; string[] strCol4; string[] strCol5; string[] strCol6; DataType.Data dataType; double coordinateCloseError; double angleCloseError; string[] split = { "," }; using (StreamReader sr = new StreamReader(filePath, Encoding.Default)) { string strDataType = sr.ReadLine().Trim(); dataType = (DataType.Data)Enum.Parse(typeof(DataType.Data), strDataType.Split(split, StringSplitOptions.RemoveEmptyEntries)[0], false); coordinateCloseError = Convert.ToDouble(sr.ReadLine().Trim()); angleCloseError = Convert.ToDouble(sr.ReadLine().Trim()); strCol0 = sr.ReadLine().Trim().Split(split, StringSplitOptions.RemoveEmptyEntries); strCol1 = sr.ReadLine().Trim().Split(split, StringSplitOptions.RemoveEmptyEntries); strCol2 = sr.ReadLine().Trim().Split(split, StringSplitOptions.RemoveEmptyEntries); strCol3 = sr.ReadLine().Trim().Split(split, StringSplitOptions.RemoveEmptyEntries); strCol4 = sr.ReadLine().Trim().Split(split, StringSplitOptions.RemoveEmptyEntries); strCol5 = sr.ReadLine().Trim().Split(split, StringSplitOptions.RemoveEmptyEntries); strCol6 = sr.ReadLine().Trim().Split(split, StringSplitOptions.RemoveEmptyEntries); } GetList(strCol0, ref col0); GetList(strCol1, ref col1); GetList(strCol2, ref col2); GetList(strCol3, ref col3); GetList(strCol4, ref col4); GetList(strCol5, ref col5); GetList(strCol6, ref col6); for (int i = 0; i < (tableLayoutPanel.RowCount - 3) / 2; i++) { tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 21f)); TextBox txtBoxCol4 = new TextBox(); txtBoxCol4.Name = "txtBoxCol4" + i; txtBoxCol4.Multiline = true; txtBoxCol4.Margin = new Padding(0); txtBoxCol4.Text = col4[i]; txtBoxCol4.Width = 56; txtBoxCol4.Height = 44; txtBoxCol4.TextAlign = HorizontalAlignment.Center; txtBoxCol4.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol4, 4, i * 2 + 2); Control[] ctrlTxtBoxCol4 = tableLayoutPanel.Controls.Find(txtBoxCol4.Name, false); tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol4[0], 2); } for (int i = 0; i < (tableLayoutPanel.RowCount - 3) / backCount / 2; i++) { tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 21f)); TextBox txtBoxCol5 = new TextBox(); txtBoxCol5.Name = "txtBoxCol5" + i; txtBoxCol5.Multiline = true; txtBoxCol5.Margin = new Padding(0); txtBoxCol5.Text = col5[i]; txtBoxCol5.Width = 108; txtBoxCol5.Height = backCount * 44; txtBoxCol5.TextAlign = HorizontalAlignment.Center; txtBoxCol5.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol5, 5, i * 2 * backCount + 2); Control[] ctrlTxtBoxCol5 = tableLayoutPanel.Controls.Find(txtBoxCol5.Name, false); tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol5[0], backCount * 2); } //填充方位角 if (dataType == DataType.Data.ConnectingTraverse) { tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 21f)); TextBox txtBoxCol = new TextBox(); txtBoxCol.Name = "txtBoxCol62"; txtBoxCol.Multiline = true; txtBoxCol.Margin = new Padding(0); txtBoxCol.Text = col6[2]; txtBoxCol.Width = 108; txtBoxCol.Height = backCount * 21; txtBoxCol.TextAlign = HorizontalAlignment.Center; txtBoxCol.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol, 6, backCount + 2); Control[] ctrlTxtBoxCol = tableLayoutPanel.Controls.Find(txtBoxCol.Name, false); tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol[0], backCount); for (int i = 3; i < (tableLayoutPanel.RowCount - 3) / backCount / 2 + 1; i++) { tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 21f)); TextBox txtBoxCol6 = new TextBox(); txtBoxCol6.Name = "txtBoxCol6" + i; txtBoxCol6.Multiline = true; txtBoxCol6.Margin = new Padding(0); txtBoxCol6.Text = col6[i]; txtBoxCol6.Width = 108; txtBoxCol6.Height = backCount * 44; txtBoxCol6.TextAlign = HorizontalAlignment.Center; txtBoxCol6.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol6, 6, (i - 2) * 2 * backCount + 2); Control[] ctrlTxtBoxCol6 = tableLayoutPanel.Controls.Find(txtBoxCol6.Name, false); tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol6[0], backCount * 2); } tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 21f)); TextBox txtRemark = new TextBox(); txtRemark.Name = "txtRemark"; txtRemark.Multiline = true; txtRemark.Margin = new Padding(0); txtRemark.Width = 550; txtRemark.Height = 21; txtRemark.BorderStyle = BorderStyle.None; txtRemark.Text = " 类型:闭附合路线 角度闭合差:" + angleCloseError; tableLayoutPanel.Controls.Add(txtRemark, 1, tableLayoutPanel.RowCount - 1); Control[] ctrlTxtRemark = tableLayoutPanel.Controls.Find(txtRemark.Name, false); tableLayoutPanel.SetColumnSpan(ctrlTxtRemark[0], 6); } else { tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 21f)); TextBox txtBoxCol = new TextBox(); txtBoxCol.Name = "txtBoxCol61"; txtBoxCol.Multiline = true; txtBoxCol.Margin = new Padding(0); txtBoxCol.Text = col6[1]; txtBoxCol.Width = 108; txtBoxCol.Height = backCount * 21; txtBoxCol.TextAlign = HorizontalAlignment.Center; txtBoxCol.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol, 6, backCount + 2); Control[] ctrlTxtBoxCol = tableLayoutPanel.Controls.Find(txtBoxCol.Name, false); tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol[0], backCount); for (int i = 2; i < (tableLayoutPanel.RowCount - 3) / backCount / 2 + 1; i++) { tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 21f)); TextBox txtBoxCol6 = new TextBox(); txtBoxCol6.Name = "txtBoxCol6" + i; txtBoxCol6.Multiline = true; txtBoxCol6.Margin = new Padding(0); txtBoxCol6.Text = col6[i]; txtBoxCol6.Width = 108; txtBoxCol6.Height = backCount * 44; txtBoxCol6.TextAlign = HorizontalAlignment.Center; txtBoxCol6.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtBoxCol6, 6, (i - 1) * 2 * backCount + 2); Control[] ctrlTxtBoxCol6 = tableLayoutPanel.Controls.Find(txtBoxCol6.Name, false); tableLayoutPanel.SetRowSpan(ctrlTxtBoxCol6[0], backCount * 2); } tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 21f)); TextBox txtRemark = new TextBox(); txtRemark.Name = "txtRemark"; txtRemark.Multiline = true; txtRemark.Margin = new Padding(0); txtRemark.Width = 550; txtRemark.Height = 21; txtRemark.Text = " 类型:支导线路线"; txtRemark.BorderStyle = BorderStyle.None; tableLayoutPanel.Controls.Add(txtRemark, 1, tableLayoutPanel.RowCount - 1); Control[] ctrlTxtRemark = tableLayoutPanel.Controls.Find(txtRemark.Name, false); tableLayoutPanel.SetColumnSpan(ctrlTxtRemark[0], 6); } }