当前位置: 首页>>代码示例>>C#>>正文


C# TableLayoutPanel.SetColumnSpan方法代码示例

本文整理汇总了C#中System.Windows.Forms.TableLayoutPanel.SetColumnSpan方法的典型用法代码示例。如果您正苦于以下问题:C# TableLayoutPanel.SetColumnSpan方法的具体用法?C# TableLayoutPanel.SetColumnSpan怎么用?C# TableLayoutPanel.SetColumnSpan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.TableLayoutPanel的用法示例。


在下文中一共展示了TableLayoutPanel.SetColumnSpan方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddPlatformTargetSection

 private int AddPlatformTargetSection(TableLayoutPanel mainPanel, int startingRow)
 {
     TableLayoutPanel platformHeader = Utils.CreateHeaderLabel("Target");
     mainPanel.Controls.Add(platformHeader);
     mainPanel.SetColumnSpan(platformHeader, 2);
     mainPanel.Controls.Add(Utils.CreateLabel("Platform target:", Utils.Paddding().Left().Top().Bottom()));
     customTargetBox = Utils.CreateComboBox(knownTargets, Utils.Paddding().Top().Bottom());
     customTargetBox.DropDownStyle = ComboBoxStyle.DropDown;
     customTargetBox.Width =(int)(customTargetBox.Width * 1.5);
     mainPanel.Controls.Add(customTargetBox);
     return startingRow + 2;
 }
开发者ID:whuthj,项目名称:VisualRust,代码行数:12,代码来源:BuildPropertyControl.cs

示例2: AddOutputSection

 private int AddOutputSection(TableLayoutPanel mainPanel, int startingRow)
 {
     TableLayoutPanel outputHeader = Utils.CreateHeaderLabel("Compilation");
     mainPanel.Controls.Add(outputHeader);
     mainPanel.SetColumnSpan(outputHeader, 2);
     mainPanel.Controls.Add(Utils.CreateLabel("Optimization level:", Utils.Paddding().Left().Top()));
     optimizationBox = Utils.CreateComboBox(
         new string[] 
         {
             OptimizationLevel.O0.ToDisplayString(),
             OptimizationLevel.O1.ToDisplayString(),
             OptimizationLevel.O2.ToDisplayString(),
             OptimizationLevel.O3.ToDisplayString(),
         },
         Utils.Paddding().Top());
     mainPanel.Controls.Add(optimizationBox);
     lto = Utils.CreateCheckBox("Apply link-time optimization", Utils.Paddding().Left());
     mainPanel.Controls.Add(lto);
     mainPanel.SetColumnSpan(lto, 2);
     emitDebug = Utils.CreateCheckBox("Emit debug info", Utils.Paddding().Left().Bottom());
     mainPanel.Controls.Add(emitDebug);
     mainPanel.SetColumnSpan(emitDebug, 2);
     return startingRow + 4;
 }
开发者ID:whuthj,项目名称:VisualRust,代码行数:24,代码来源:BuildPropertyControl.cs

示例3: InitializeComponent

 private void InitializeComponent()
 {
     ComponentResourceManager manager = new ComponentResourceManager(typeof(DialogFontOptionControl));
     this.chkChangeFont = new CheckBox();
     this.cmbFontSize = new ComboBox();
     this.lblFontSize = new Label();
     this.lblFontFamily = new Label();
     this.cmbFontFamily = new ComboBox();
     TableLayoutPanel panel = new TableLayoutPanel();
     panel.SuspendLayout();
     base.SuspendLayout();
     manager.ApplyResources(panel, "tlpBack");
     panel.Controls.Add(this.chkChangeFont, 0, 0);
     panel.Controls.Add(this.cmbFontSize, 2, 2);
     panel.Controls.Add(this.lblFontSize, 1, 2);
     panel.Controls.Add(this.lblFontFamily, 1, 1);
     panel.Controls.Add(this.cmbFontFamily, 2, 1);
     panel.Name = "tlpBack";
     manager.ApplyResources(this.chkChangeFont, "chkChangeFont");
     panel.SetColumnSpan(this.chkChangeFont, 3);
     this.chkChangeFont.Name = "chkChangeFont";
     this.chkChangeFont.UseVisualStyleBackColor = true;
     this.chkChangeFont.CheckedChanged += new EventHandler(this.chkChangeFont_CheckedChanged);
     manager.ApplyResources(this.cmbFontSize, "cmbFontSize");
     this.cmbFontSize.FormattingEnabled = true;
     this.cmbFontSize.Items.AddRange(new object[] { manager.GetString("cmbFontSize.Items"), manager.GetString("cmbFontSize.Items1"), manager.GetString("cmbFontSize.Items2"), manager.GetString("cmbFontSize.Items3"), manager.GetString("cmbFontSize.Items4"), manager.GetString("cmbFontSize.Items5"), manager.GetString("cmbFontSize.Items6"), manager.GetString("cmbFontSize.Items7"), manager.GetString("cmbFontSize.Items8"), manager.GetString("cmbFontSize.Items9"), manager.GetString("cmbFontSize.Items10") });
     this.cmbFontSize.Name = "cmbFontSize";
     this.cmbFontSize.Leave += new EventHandler(this.cmbFontSize_Leave);
     this.cmbFontSize.Enter += new EventHandler(this.cmbFontSize_Enter);
     manager.ApplyResources(this.lblFontSize, "lblFontSize");
     this.lblFontSize.Name = "lblFontSize";
     manager.ApplyResources(this.lblFontFamily, "lblFontFamily");
     this.lblFontFamily.Name = "lblFontFamily";
     this.cmbFontFamily.AutoCompleteMode = AutoCompleteMode.Append;
     this.cmbFontFamily.AutoCompleteSource = AutoCompleteSource.ListItems;
     this.cmbFontFamily.DisplayMember = "Name";
     manager.ApplyResources(this.cmbFontFamily, "cmbFontFamily");
     this.cmbFontFamily.Name = "cmbFontFamily";
     manager.ApplyResources(this, "$this");
     base.AutoScaleMode = AutoScaleMode.Font;
     base.Controls.Add(panel);
     base.Name = "DialogFontOptionControl";
     panel.ResumeLayout(false);
     panel.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:47,代码来源:DialogFontOptionControl.cs

示例4: NbrCarresEnigmaPanel

        /// <summary>
        /// Constructeur par défaut, génère un texte et l'affiche dans le Panel.
        /// </summary>
        public NbrCarresEnigmaPanel()
        {
            Label lblEnigme = new Label();

            PictureBox pbxImage = new PictureBox();

            lblEnigme.Text = "Combien y a-t-il de carrés ?";
            pbxImage.BackgroundImage = Properties.Resources.carre;

            TableLayoutPanel centerQuestion = new TableLayoutPanel();
            centerQuestion.ColumnCount = 5;
            centerQuestion.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.5f));
            centerQuestion.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
            centerQuestion.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
            centerQuestion.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
            centerQuestion.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 0.5f));
            centerQuestion.RowCount = 4;
            centerQuestion.RowStyles.Add(new RowStyle(SizeType.Percent, 0.5f));
            centerQuestion.RowStyles.Add(new RowStyle(SizeType.AutoSize));
            centerQuestion.RowStyles.Add(new RowStyle(SizeType.AutoSize));
            centerQuestion.RowStyles.Add(new RowStyle(SizeType.Percent, 0.5f));

            centerQuestion.SetColumnSpan(lblEnigme, 3);

            lblEnigme.Font = new Font(FontFamily.GenericSansSerif, 24, FontStyle.Bold);

            pbxImage.Size = new Size(295, 303);
            lblEnigme.AutoSize = true;

            centerQuestion.Controls.Add(lblEnigme, 1, 1);
            centerQuestion.Controls.Add(pbxImage, 2, 2);

            centerQuestion.Dock = DockStyle.Fill;

            Controls.Add(centerQuestion);
        }
开发者ID:GregBourquin,项目名称:enigmos,代码行数:39,代码来源:NbrCarresEnigmaPanel.cs

示例5: CreateForm

 private static FormContent CreateForm()
 {
     var startPageText = new TextBox { Name = "StartPage", Width = 150 };
     var depthText = new TextBox { Name = "Depth", Width = 50 };
     var viewer = new GViewer { Dock = DockStyle.Fill, Graph = new Graph("someGraph") };
     var layoutPanel = new TableLayoutPanel
                           {
                               Dock = DockStyle.Fill,
                               Controls =
                                   {
                                       { FlowLayout(Label("Start Page:"), startPageText), 0, 0 },
                                       { FlowLayout(Label("Depth:"), depthText), 1, 0 },
                                       { viewer, 0, 1 }
                                   }
                           };
     layoutPanel.SetColumnSpan(viewer, 2);
     var form = new Form
                    {
                        WindowState = FormWindowState.Maximized,
                        Controls = { layoutPanel },
                        Text = Assembly.GetExecutingAssembly().GetName().Name
                    };
     return new FormContent { Form = form, DepthText = depthText, StartPageText = startPageText, Viewer = viewer };
 }
开发者ID:undeadcat,项目名称:WikiCrawler,代码行数:24,代码来源:Program.cs

示例6: TestCellPositioning8

		public void TestCellPositioning8 ()
		{
			// Column span
			TableLayoutPanel p = new TableLayoutPanel ();
			Control c1 = new Button ();
			Control c2 = new Button ();
			Control c3 = new Button ();

			p.ColumnCount = 2;
			p.RowCount = 2;

			p.SetColumnSpan (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 (0, 1), p.GetPositionFromControl (c2), "C2");
			Assert.AreEqual (new TableLayoutPanelCellPosition (1, 1), p.GetPositionFromControl (c3), "C3");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:21,代码来源:TableLayoutTest.cs

示例7: XamarinBug18638

		public void XamarinBug18638 ()
		{
			// Spanning items should not have their entire width assigned to the first column in the span.
			TableLayoutPanel tlp = new TableLayoutPanel ();
			tlp.SuspendLayout ();
			tlp.Size = new Size(291, 100);
			tlp.AutoSize = true;
			tlp.ColumnStyles.Add (new ColumnStyle (SizeType.Absolute, 60));
			tlp.ColumnStyles.Add (new ColumnStyle (SizeType.Percent, 100));
			tlp.ColumnStyles.Add (new ColumnStyle (SizeType.Absolute, 45));
			tlp.ColumnCount = 3;
			tlp.RowStyles.Add (new RowStyle (SizeType.AutoSize));
			var label1 = new Label {AutoSize = true, Text = @"This line spans all three columns in the table!"};
			tlp.Controls.Add (label1, 0, 0);
			tlp.SetColumnSpan (label1, 3);
			tlp.RowStyles.Add (new RowStyle (SizeType.AutoSize));
			tlp.RowCount = 1;
			var label2 = new Label {AutoSize = true, Text = @"This line spans columns two and three."};
			tlp.Controls.Add (label2, 1, 1);
			tlp.SetColumnSpan (label2, 2);
			tlp.RowCount = 2;
			AddTableRow (tlp, "First Row", "This is a test");
			AddTableRow (tlp, "Row 2", "This is another test");
			tlp.ResumeLayout ();

			var widths = tlp.GetColumnWidths ();
			Assert.AreEqual (4, tlp.RowCount, "X18638-1");
			Assert.AreEqual (3, tlp.ColumnCount, "X18638-2");
			Assert.AreEqual (60, widths[0], "X18638-3");
			Assert.Greater (label2.Width, widths[1], "X18638-5");
			Assert.AreEqual (45, widths[2], "X18638-4");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:32,代码来源:TableLayoutTest.cs

示例8: Bug367249

		public void Bug367249 ()
		{
			// Setting a colspan greater than the number of columns was
			// causing an IOORE, this test just should not exception
			TableLayoutPanel LayoutPanel = new TableLayoutPanel ();
			LayoutPanel.ColumnCount = 1;
			LayoutPanel.RowCount = 2;

			Button OkButton = new Button ();
			OkButton.Text = "OK";
			LayoutPanel.Controls.Add (OkButton);
			LayoutPanel.SetColumnSpan (OkButton, 3);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:13,代码来源:TableLayoutTest.cs

示例9: InitializeComponent

 private void InitializeComponent()
 {
     ComponentResourceManager manager = new ComponentResourceManager(typeof(FtpConnectDialog));
     this.rbAnonymous = new System.Windows.Forms.RadioButton();
     this.chkShowPassword = new System.Windows.Forms.CheckBox();
     this.lblPassword = new Label();
     this.rbCredentials = new System.Windows.Forms.RadioButton();
     this.cmbUserName = new System.Windows.Forms.ComboBox();
     this.lblUserName = new Label();
     this.txtPassword = new System.Windows.Forms.TextBox();
     this.tbcBack = new TabControl();
     this.tpBasic = new TabPage();
     this.tlpBasic = new TableLayoutPanel();
     this.lblServer = new Label();
     this.cmbServer = new System.Windows.Forms.ComboBox();
     this.tlpNote = new TableLayoutPanel();
     this.lblNote = new Label();
     this.imgNote = new PictureBox();
     this.tpContext = new TabPage();
     this.FtpOptions = new FtpOptionControl();
     this.tlpBack = new TableLayoutPanel();
     this.btnOk = new System.Windows.Forms.Button();
     this.btnCancel = new System.Windows.Forms.Button();
     this.Validator = new ValidatorProvider();
     this.tlpButtons = new TableLayoutPanel();
     this.bvlButtons = new Bevel();
     System.Windows.Forms.GroupBox box = new System.Windows.Forms.GroupBox();
     TableLayoutPanel panel = new TableLayoutPanel();
     box.SuspendLayout();
     panel.SuspendLayout();
     this.tbcBack.SuspendLayout();
     this.tpBasic.SuspendLayout();
     this.tlpBasic.SuspendLayout();
     this.tlpNote.SuspendLayout();
     ((ISupportInitialize) this.imgNote).BeginInit();
     this.tpContext.SuspendLayout();
     this.tlpBack.SuspendLayout();
     this.tlpButtons.SuspendLayout();
     base.SuspendLayout();
     manager.ApplyResources(box, "grpLogin");
     box.Controls.Add(panel);
     box.Name = "grpLogin";
     box.TabStop = false;
     manager.ApplyResources(panel, "tlpCredentials");
     panel.Controls.Add(this.rbAnonymous, 0, 0);
     panel.Controls.Add(this.chkShowPassword, 2, 4);
     panel.Controls.Add(this.lblPassword, 1, 3);
     panel.Controls.Add(this.rbCredentials, 0, 1);
     panel.Controls.Add(this.cmbUserName, 2, 2);
     panel.Controls.Add(this.lblUserName, 1, 2);
     panel.Controls.Add(this.txtPassword, 2, 3);
     panel.Name = "tlpCredentials";
     manager.ApplyResources(this.rbAnonymous, "rbAnonymous");
     this.rbAnonymous.Checked = true;
     panel.SetColumnSpan(this.rbAnonymous, 3);
     this.rbAnonymous.Name = "rbAnonymous";
     this.rbAnonymous.TabStop = true;
     this.rbAnonymous.UseVisualStyleBackColor = true;
     this.rbAnonymous.CheckedChanged += new EventHandler(this.rbAnonymous_CheckedChanged);
     manager.ApplyResources(this.chkShowPassword, "chkShowPassword");
     this.chkShowPassword.Checked = Settings.Default.RunAsShowPassword;
     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);
     manager.ApplyResources(this.lblPassword, "lblPassword");
     this.lblPassword.MinimumSize = new Size(80, 0);
     this.lblPassword.Name = "lblPassword";
     manager.ApplyResources(this.rbCredentials, "rbCredentials");
     panel.SetColumnSpan(this.rbCredentials, 3);
     this.rbCredentials.Name = "rbCredentials";
     this.rbCredentials.UseVisualStyleBackColor = true;
     this.rbCredentials.CheckedChanged += new EventHandler(this.rbAnonymous_CheckedChanged);
     manager.ApplyResources(this.cmbUserName, "cmbUserName");
     this.cmbUserName.FormattingEnabled = true;
     this.cmbUserName.Name = "cmbUserName";
     this.Validator.SetValidateOn(this.cmbUserName, ValidateOn.TextChanged);
     this.cmbUserName.Validating += new CancelEventHandler(this.cmbUserName_Validating);
     manager.ApplyResources(this.lblUserName, "lblUserName");
     this.lblUserName.MinimumSize = new Size(80, 0);
     this.lblUserName.Name = "lblUserName";
     manager.ApplyResources(this.txtPassword, "txtPassword");
     this.txtPassword.Name = "txtPassword";
     this.txtPassword.UseSystemPasswordChar = true;
     this.tbcBack.Controls.Add(this.tpBasic);
     this.tbcBack.Controls.Add(this.tpContext);
     manager.ApplyResources(this.tbcBack, "tbcBack");
     this.tbcBack.Name = "tbcBack";
     this.tbcBack.SelectedIndex = 0;
     this.tpBasic.Controls.Add(this.tlpBasic);
     manager.ApplyResources(this.tpBasic, "tpBasic");
     this.tpBasic.Name = "tpBasic";
     this.tpBasic.UseVisualStyleBackColor = true;
     manager.ApplyResources(this.tlpBasic, "tlpBasic");
     this.tlpBasic.Controls.Add(this.lblServer, 0, 0);
     this.tlpBasic.Controls.Add(box, 0, 2);
     this.tlpBasic.Controls.Add(this.cmbServer, 0, 1);
     this.tlpBasic.Controls.Add(this.tlpNote, 0, 3);
     this.tlpBasic.GrowStyle = TableLayoutPanelGrowStyle.FixedSize;
     this.tlpBasic.Name = "tlpBasic";
//.........这里部分代码省略.........
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:101,代码来源:FtpConnectDialog.cs

示例10: InitComponents

        /* Initializes the components. */
        private void InitComponents(string[,] connections)
        {
            Panel rootPanel = new Panel();
            rootPanel.Size = new Size(ClientSize.Width - 10, ClientSize.Height - 10);
            rootPanel.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
            rootPanel.Location = new Point(5, 5);
            rootPanel.BackColor = Color.Transparent;

            TableLayoutPanel generalTlp = new TableLayoutPanel();
            generalTlp.AutoSize = true;
            generalTlp.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));

            Label ipLabel = new Label();
            ipLabel.Text = "IP-Address:";
            ipLabel.AutoSize = true;
            ipLabel.Anchor = AnchorStyles.None;

            IpComboBox = new ComboBox();
            IpComboBox.AutoSize = true;
            IpComboBox.Anchor = AnchorStyles.None;
            IpComboBox.SelectedIndexChanged += ipComboBox_SelectedIndexChanged;

            Label portLabel = new Label();
            portLabel.Text = "Port:";
            portLabel.AutoSize = true;
            portLabel.Anchor = AnchorStyles.None;

            PortComboBox = new ComboBox();
            PortComboBox.AutoSize = true;
            PortComboBox.Anchor = AnchorStyles.None;

            for (int i = 0; i < connections.GetLength(0); i++)
            {
                IpComboBox.Items.Add(connections[i, 0]);
                PortComboBox.Items.Add(connections[i, 1]);
            }

            if (connections.Length > 0)
            {
                IpComboBox.SelectedIndex = 0;
                PortComboBox.SelectedIndex = 0;
            }

            generalTlp.Controls.Add(ipLabel, 0, 0);
            generalTlp.Controls.Add(IpComboBox, 1, 0);
            generalTlp.Controls.Add(portLabel, 0, 1);
            generalTlp.Controls.Add(PortComboBox, 1, 1);

            FlowLayoutPanel flp = new FlowLayoutPanel();
            flp.AutoSize = true;
            flp.Dock = DockStyle.Right;

            buttonOk = new Button();
            buttonOk.Text = "OK";
            buttonOk.DialogResult = DialogResult.OK;
            buttonOk.FlatStyle = FlatStyle.Flat;
            buttonOk.FlatAppearance.MouseOverBackColor = Color.LightGreen;
            buttonOk.Click += buttonOk_Click;
            buttonOk.Cursor = Cursors.Hand;
            AcceptButton = buttonOk;

            buttonCancel = new Button();
            buttonCancel.Text = "Cancel";
            buttonCancel.DialogResult = DialogResult.Cancel;
            buttonCancel.FlatStyle = FlatStyle.Flat;
            buttonCancel.FlatAppearance.MouseOverBackColor = Color.Red;
            buttonCancel.Click += buttonCancel_Click;
            buttonCancel.Cursor = Cursors.Hand;

            flp.Controls.Add(buttonOk);
            flp.Controls.Add(buttonCancel);

            generalTlp.Controls.Add(flp, 0, 2);
            generalTlp.SetColumnSpan(flp, 2);

            rootPanel.Controls.Add(generalTlp);
            Controls.Add(rootPanel);
        }
开发者ID:Jecral,项目名称:Football,代码行数:79,代码来源:ConnectionForm.cs

示例11: TestRowColumnSizes11

		public void TestRowColumnSizes11 ()
		{
			// AutoSize Columns/Rows, and column-spanning controls, but
			// no control starts in column 1.
			// Mono's old behavior was for column 1 to have a zero width.
			TableLayoutPanel p = new TableLayoutPanel ();
			Control c1 = new Button ();
			Control c2 = new Button ();
			Control c3 = new Button ();

			c1.Size = new Size (150, 25);
			c2.Size = new Size (75, 25);
			c3.Size = new Size (150, 25);

			p.ColumnCount = 4;
			p.RowCount = 3;

			p.RowStyles.Add (new RowStyle (SizeType.AutoSize));
			p.RowStyles.Add (new RowStyle (SizeType.AutoSize));
			p.RowStyles.Add (new RowStyle (SizeType.AutoSize));
			p.ColumnStyles.Add (new ColumnStyle (SizeType.AutoSize));
			p.ColumnStyles.Add (new ColumnStyle (SizeType.AutoSize));
			p.ColumnStyles.Add (new ColumnStyle (SizeType.AutoSize));
			p.ColumnStyles.Add (new ColumnStyle (SizeType.AutoSize));

			p.SetColumnSpan (c1, 2);
			p.SetColumnSpan (c3, 2);

			p.Controls.Add (c1, 0, 0);
			p.Controls.Add (c2, 0, 1);
			p.Controls.Add (c3, 1, 1);

			// The bug fix gets Mono to behave very closely to .NET,
			// but not exactly...3 pixels off somewhere...
			Assert.AreEqual (31, p.GetRowHeights ()[0], "D1");
			Assert.AreEqual (31, p.GetRowHeights ()[1], "D2");
			Assert.AreEqual (81, p.GetColumnWidths ()[0], "D3");
			Assert.LessOrEqual (75, p.GetColumnWidths ()[1], "D4");
			Assert.GreaterOrEqual (78, p.GetColumnWidths ()[1], "D5");
			Assert.LessOrEqual (78, p.GetColumnWidths ()[2], "D6");
			Assert.GreaterOrEqual (81, p.GetColumnWidths ()[2], "D7");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:42,代码来源:TableLayoutTest.cs

示例12: TestCellPositioning18

		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");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:28,代码来源:TableLayoutTest.cs

示例13: InitializeComponent

 private void InitializeComponent()
 {
     ComponentResourceManager manager = new ComponentResourceManager(typeof(SelectDialog));
     this.rbMask = new RadioButton();
     this.cmbMask = new ComboBox();
     this.chkExceptMask = new CheckBox();
     this.rbFilter = new RadioButton();
     this.lstFilters = new ListBox();
     this.chkSelectFolders = new CheckBox();
     this.btnOk = new Button();
     this.btnCancel = new Button();
     this.bvlButtons = new Bevel();
     TableLayoutPanel panel = new TableLayoutPanel();
     TableLayoutPanel panel2 = new TableLayoutPanel();
     panel.SuspendLayout();
     panel2.SuspendLayout();
     base.SuspendLayout();
     manager.ApplyResources(panel, "tlpBack");
     panel.Controls.Add(this.rbMask, 0, 0);
     panel.Controls.Add(this.cmbMask, 1, 1);
     panel.Controls.Add(this.chkExceptMask, 1, 3);
     panel.Controls.Add(this.rbFilter, 0, 4);
     panel.Controls.Add(this.lstFilters, 1, 5);
     panel.Controls.Add(this.chkSelectFolders, 1, 2);
     panel.Name = "tlpBack";
     manager.ApplyResources(this.rbMask, "rbMask");
     this.rbMask.Checked = true;
     panel.SetColumnSpan(this.rbMask, 2);
     this.rbMask.Name = "rbMask";
     this.rbMask.TabStop = true;
     this.rbMask.UseVisualStyleBackColor = true;
     this.rbMask.Click += new EventHandler(this.rbMask_Click);
     manager.ApplyResources(this.cmbMask, "cmbMask");
     this.cmbMask.Name = "cmbMask";
     this.cmbMask.TextUpdate += new EventHandler(this.cmbMask_TextUpdate);
     manager.ApplyResources(this.chkExceptMask, "chkExceptMask");
     this.chkExceptMask.Name = "chkExceptMask";
     this.chkExceptMask.UseVisualStyleBackColor = true;
     manager.ApplyResources(this.rbFilter, "rbFilter");
     panel.SetColumnSpan(this.rbFilter, 2);
     this.rbFilter.Name = "rbFilter";
     this.rbFilter.UseVisualStyleBackColor = true;
     this.rbFilter.Click += new EventHandler(this.rbFilter_Click);
     manager.ApplyResources(this.lstFilters, "lstFilters");
     this.lstFilters.FormattingEnabled = true;
     this.lstFilters.Name = "lstFilters";
     this.lstFilters.Enter += new EventHandler(this.lstFilters_Enter);
     manager.ApplyResources(this.chkSelectFolders, "chkSelectFolders");
     this.chkSelectFolders.Name = "chkSelectFolders";
     this.chkSelectFolders.UseVisualStyleBackColor = true;
     manager.ApplyResources(panel2, "tlpButtons");
     panel2.Controls.Add(this.btnOk, 1, 0);
     panel2.Controls.Add(this.btnCancel, 2, 0);
     panel2.GrowStyle = TableLayoutPanelGrowStyle.FixedSize;
     panel2.Name = "tlpButtons";
     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.CausesValidation = false;
     this.btnCancel.DialogResult = DialogResult.Cancel;
     this.btnCancel.Name = "btnCancel";
     this.btnCancel.UseVisualStyleBackColor = true;
     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(panel2);
     base.Controls.Add(this.bvlButtons);
     base.Controls.Add(panel);
     base.FixMouseWheel = Settings.Default.FixMouseWheel;
     base.FormBorderStyle = FormBorderStyle.FixedDialog;
     base.MaximizeBox = false;
     base.MinimizeBox = false;
     base.Name = "SelectDialog";
     base.ShowInTaskbar = false;
     base.Shown += new EventHandler(this.SelectDialog_Shown);
     base.FormClosed += new FormClosedEventHandler(this.SelectDialog_FormClosed);
     panel.ResumeLayout(false);
     panel.PerformLayout();
     panel2.ResumeLayout(false);
     panel2.PerformLayout();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:91,代码来源:SelectDialog.cs

示例14: InitializeComponent

        /// <summary>
        /// Required method for Designer support - do not modify
        ///   the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Windows.Forms.TableLayoutPanel mainTable;
            System.Windows.Forms.Label nameLabel;
            this.listResults = new System.Windows.Forms.ListView();
            this.nameColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
            this.idColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
            this.nameText = new System.Windows.Forms.TextBox();
            this.searchButton = new System.Windows.Forms.Button();
            this.closeButton = new System.Windows.Forms.Button();
            this.selectButton = new System.Windows.Forms.Button();
            mainTable = new System.Windows.Forms.TableLayoutPanel();
            nameLabel = new System.Windows.Forms.Label();
            mainTable.SuspendLayout();
            this.SuspendLayout();
            // 
            // mainTable
            // 
            mainTable.ColumnCount = 5;
            mainTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 44F));
            mainTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            mainTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 81F));
            mainTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 81F));
            mainTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 81F));
            mainTable.Controls.Add(this.listResults, 0, 0);
            mainTable.Controls.Add(nameLabel, 0, 1);
            mainTable.Controls.Add(this.nameText, 1, 1);
            mainTable.Controls.Add(this.searchButton, 2, 1);
            mainTable.Controls.Add(this.closeButton, 4, 1);
            mainTable.Controls.Add(this.selectButton, 3, 1);
            mainTable.Dock = System.Windows.Forms.DockStyle.Fill;
            mainTable.Location = new System.Drawing.Point(0, 0);
            mainTable.Name = "mainTable";
            mainTable.RowCount = 2;
            mainTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 89.31298F));
            mainTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.68702F));
            mainTable.Size = new System.Drawing.Size(458, 237);
            mainTable.TabIndex = 1;
            // 
            // listResults
            // 
            this.listResults.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.nameColumn,
            this.idColumn});
            mainTable.SetColumnSpan(this.listResults, 5);
            this.listResults.Dock = System.Windows.Forms.DockStyle.Fill;
            this.listResults.FullRowSelect = true;
            this.listResults.Location = new System.Drawing.Point(3, 3);
            this.listResults.MultiSelect = false;
            this.listResults.Name = "listResults";
            this.listResults.Size = new System.Drawing.Size(452, 205);
            this.listResults.TabIndex = 0;
            this.listResults.UseCompatibleStateImageBehavior = false;
            this.listResults.View = System.Windows.Forms.View.Details;
            this.listResults.DoubleClick += new System.EventHandler(this.ListResultsDoubleClick);
            // 
            // nameColumn
            // 
            this.nameColumn.Text = "Show Name";
            this.nameColumn.Width = 338;
            // 
            // idColumn
            // 
            this.idColumn.Text = "TVDB ID";
            this.idColumn.Width = 105;
            // 
            // nameLabel
            // 
            nameLabel.Anchor = System.Windows.Forms.AnchorStyles.Right;
            nameLabel.AutoSize = true;
            nameLabel.Location = new System.Drawing.Point(3, 217);
            nameLabel.Name = "nameLabel";
            nameLabel.Size = new System.Drawing.Size(38, 13);
            nameLabel.TabIndex = 1;
            nameLabel.Text = "Name:";
            // 
            // nameText
            // 
            this.nameText.Dock = System.Windows.Forms.DockStyle.Fill;
            this.nameText.Location = new System.Drawing.Point(47, 214);
            this.nameText.Name = "nameText";
            this.nameText.Size = new System.Drawing.Size(165, 20);
            this.nameText.TabIndex = 2;
            // 
            // searchButton
            // 
            this.searchButton.Dock = System.Windows.Forms.DockStyle.Fill;
            this.searchButton.Location = new System.Drawing.Point(218, 214);
            this.searchButton.Name = "searchButton";
            this.searchButton.Size = new System.Drawing.Size(75, 20);
            this.searchButton.TabIndex = 3;
            this.searchButton.Text = "Search";
            this.searchButton.UseVisualStyleBackColor = true;
            this.searchButton.Click += new System.EventHandler(this.SearchButtonClick);
            // 
            // closeButton
//.........这里部分代码省略.........
开发者ID:nicolaspierre1990,项目名称:tvsorter,代码行数:101,代码来源:ShowSearchDialog.Designer.cs

示例15: TradeSkillListView

        private int index; // index to Professionbuddy.Instance.TradeSkillList

        public TradeSkillListView(int index)
        {
            this.index = index;
            // Filter TextBox
            FilterText = new TextBox();
            FilterText.Dock = DockStyle.Fill;
            // Category Combobox
            CategoryCombo = new ComboBox();
            CategoryCombo.Dock = DockStyle.Fill;
            // columns
            NameColumn = new DataGridViewTextBoxColumn();
            CraftableColumn = new DataGridViewTextBoxColumn();
            DifficultyColumn = new DataGridViewTextBoxColumn();
            NameColumn.HeaderText = "Name";
            CraftableColumn.HeaderText = "#";
            NameColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            CraftableColumn.MinimumWidth = 25;
            CraftableColumn.Width = 25;
            DifficultyColumn.MinimumWidth = 25;
            DifficultyColumn.Width = 25;
            // DataGridView
            TradeDataView = new DataGridView();
            TradeDataView.Dock = DockStyle.Fill;
            TradeDataView.AllowUserToAddRows = false;
            TradeDataView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
            TradeDataView.RowHeadersVisible = false;
            TradeDataView.Columns.Add(NameColumn);
            TradeDataView.Columns.Add(CraftableColumn);
            TradeDataView.Columns.Add(DifficultyColumn);
            TradeDataView.AllowUserToResizeRows = false;
            TradeDataView.EditMode = DataGridViewEditMode.EditProgrammatically;
            TradeDataView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            TradeDataView.ColumnHeadersHeight = 21;
            TradeDataView.RowTemplate.Height = 16;
            //table layout
            tabTableLayout = new TableLayoutPanel();
            tabTableLayout.ColumnCount = 2;
            tabTableLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
            tabTableLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
            tabTableLayout.RowCount = 2;
            tabTableLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 30F));
            tabTableLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
            tabTableLayout.Controls.Add(FilterText, 0, 0);
            tabTableLayout.Controls.Add(CategoryCombo, 1, 0);
            tabTableLayout.Controls.Add(TradeDataView, 0, 1);
            tabTableLayout.Dock = DockStyle.Fill;
            tabTableLayout.SetColumnSpan(TradeDataView, 2);
            // tab
            this.Controls.Add(tabTableLayout);
            this.Text = Professionbuddy.Instance.TradeSkillList[index].Name;
            // populate the controls with data
            CategoryCombo.Items.Add(""); // blank line will show all headers...

            foreach (KeyValuePair<uint, Recipe> kv in Professionbuddy.Instance.TradeSkillList[index].Recipes)
            {
                if (!CategoryCombo.Items.Contains(kv.Value.Header))
                {
                    CategoryCombo.Items.Add(kv.Value.Header);
                }
                TradeDataView.Rows.Add(new TradeSkillRecipeCell(index, kv.Key), Util.CalculateRecipeRepeat(kv.Value),
                                       (int)kv.Value.Difficulty); // make color column sortable by dificulty..
            }
            TradeDataView_SelectionChanged(null, null);
            // hook events
            FilterText.TextChanged += new EventHandler(FilterText_TextChanged);
            CategoryCombo.SelectedValueChanged += new EventHandler(SectionCombo_SelectedValueChanged);
            TradeDataView.SelectionChanged += new EventHandler(TradeDataView_SelectionChanged);
            TradeDataView.CellFormatting += new DataGridViewCellFormattingEventHandler(TradeDataView_CellFormatting);
        }
开发者ID:naacra,项目名称:wowhbbotcracked,代码行数:71,代码来源:TradeSkillListView.cs


注:本文中的System.Windows.Forms.TableLayoutPanel.SetColumnSpan方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。