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


C# TableLayoutPanel.SetColumn方法代码示例

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


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

示例1: Init

 private void Init()
 {
     layoutPanel = new TableLayoutPanel();
     layoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.InsetDouble;
     layoutPanel.Dock = DockStyle.Fill;
     this.machinePanel.Controls.Add(layoutPanel);
     int row = 4, col = 4;
     DynamicLayout(layoutPanel, row, col);
     int index = 1;
     for (int i = 0; i < row; i++)
     {
         for (int j = 0; j < col; j++)
         {
             MachineControl machine = new MachineControl();
             uiMachines[index-1] = machine;
             machine.Dock = DockStyle.Fill;
             //machine.IPAddress = string.Format("192.168.0.{0:G}", 4 + index);
             machine.IPAddress = MainForm.Sixteen_IP[index - 1];
             machine.anotherName = MainForm.Sixteen_Name[index - 1];
             layoutPanel.Controls.Add(machine);
             layoutPanel.SetRow(machine, i);
             layoutPanel.SetColumn(machine, j);
             index++;
         }
     }
 }
开发者ID:BUPTSSECommunity,项目名称:Nuclide-PC,代码行数:26,代码来源:Layout16.cs

示例2: CreateAdvancedSettings

        private void CreateAdvancedSettings(TabPage tabPage)
        {
            var advancedSettings = new List<String>(new[] { "VariableRefactoringStartingSeed", "ProgramTemplate" });
            foreach (SettingsProperty r in Settings.Default.Properties)
                if (r.Name.StartsWith("Regex"))
                    advancedSettings.Add(r.Name);

            advancedSettings.Sort();

            var table = new TableLayoutPanel {ColumnCount = 2, RowCount = advancedSettings.Count() + 1, Dock = DockStyle.Fill};
            
            var row = 0;
            foreach (var s in advancedSettings)
            {
                var l = new Label { Text = s, Anchor = AnchorStyles.Left, AutoSize = true };
                table.Controls.Add(l);
                table.SetRow(l, row);
                table.SetColumn(l, 0);

                var t = new TextBox { Dock = DockStyle.Fill, Multiline = true, ScrollBars = ScrollBars.Vertical, Height=38 };
                t.DataBindings.Add(new Binding("Text", Settings.Default, s, true,DataSourceUpdateMode.OnPropertyChanged));
                table.Controls.Add(t);
                table.SetRow(t, row++);
                table.SetColumn(t, 1);
            }


            for (var i = 0; i < table.ColumnCount; i++)
                table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));

            for (var i = 0; i < table.RowCount; i++)
                table.RowStyles.Add(new RowStyle(SizeType.AutoSize));

            tabPage.Controls.Add(table);
        }
开发者ID:dbbotkin,项目名称:PrimeComm,代码行数:35,代码来源:FormSettings.cs

示例3: InitializeComponent

		public void InitializeComponent() 
		{
			table = new TableLayoutPanel();
			view = new ViewportPanel();
			scroll = new VScrollBar();

			scroll.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom;
			view.Dock = DockStyle.Fill;

			table.Dock = DockStyle.Fill;
			table.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
			table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
			table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize, 0));
			table.RowCount = 1;
			table.ColumnCount = 2;
			table.Controls.Add(view);
			table.Controls.Add(scroll);
			table.SetColumn(view, 0);
			table.SetColumn(scroll, 1);

			scroll.Scroll += (sender, e) => OnScroll(e);
			view.Paint += (sender, e) => OnPaint(e);

			Controls.Add(table);
		}
开发者ID:henke37,项目名称:BizHawk,代码行数:25,代码来源:ViewportPanel.cs

示例4: TestExtenderMethods

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

示例5: TestCellPositioning12

		public void TestCellPositioning12 ()
		{
			// Requesting a column greater than ColumnCount, request is ignored
			TableLayoutPanel p = new TableLayoutPanel ();
			Control c1 = new Button ();
			Control c2 = new Button ();
			Control c3 = new Button ();

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

			p.SetColumn (c1, 4);

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

示例6: TestCellPositioning7

		public void TestCellPositioning7 ()
		{
			// One control has fixed column and row
			TableLayoutPanel p = new TableLayoutPanel ();
			Control c1 = new Button ();
			Control c2 = new Button ();
			Control c3 = new Button ();
			Control c4 = new Button ();

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

			p.SetColumn (c3, 1);
			p.SetRow (c3, 1);

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

示例7: GenerateGui

        private void GenerateGui()
        {
            var s = config.GetSections().ToList();
            s.Sort();

            foreach (var section in s)
            {
                var page = new TabPage(Utilities.GetPrettyName(section));
                var panel = new TableLayoutPanel { Dock = DockStyle.Fill, ColumnCount = 2 };
                var lastComment = "";
                var i = 0;

                foreach (var option in config.EnumSection(section))
                {

                    if (!new[] { "#", ";", "//" }.Any(c => option.StartsWith(c)))
                    {
                        var l = new Label
                        {
                            Text = Utilities.GetPrettyName(option) + ":",
                            TextAlign = ContentAlignment.MiddleLeft,
                            //Width = tabControlMain.Width/4,
                            AutoEllipsis = true
                        };
                        panel.SetColumn(l, 0);
                        panel.SetRow(l, i);
                        panel.Controls.Add(l);

                        Control t = null;
                        var defaultValue = config.GetSetting(section, option);
                        var tooltip = "";

                        // Check previous comment
                        if (!String.IsNullOrEmpty(lastComment))
                        {
                            var tmp = lastComment.Trim().Split(new[] { ']' }, 2);

                            if (tmp.Length > 1)
                                tooltip = tmp[1].Trim();

                            var m = Regex.Match(lastComment, @"\[(?<min>[-]?[\d.]{1,8}):(?<max>[-]?[\d.]{1,8})\]");
                            if (m.Success)
                            {
                                t = new NumericUpDown
                                {
                                    Minimum = decimal.Parse(m.Groups["min"].Value),
                                    Maximum = decimal.Parse(m.Groups["max"].Value),
                                    Value = decimal.Parse(defaultValue)
                                };

                                ((NumericUpDown)t).ValueChanged += (o, args) => { config.AddSetting(section, option, ((NumericUpDown)o).Value.ToString()); };
                            }
                            else
                            {
                                m = Regex.Match(lastComment, @"\[(?<value>.+,.+)\]");
                                if (m.Success)
                                {
                                    t = new ComboBox { DropDownStyle = ComboBoxStyle.DropDownList, Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right };

                                    var items = new List<String>();
                                    var description = new List<string>();
                                    foreach (var v in m.Groups["value"].Value.Split(new[] { ',' }))
                                    {
                                        String name, value;
                                        if (v.Contains(':'))
                                        {
                                            var parts = v.Split(new[] { ':' }, 2);
                                            name = parts[1];
                                            value = parts[0];
                                            description.Add(String.Format(" {0} ({1})", name, value));
                                        }
                                        else
                                        {
                                            name = v;
                                            value = v;
                                        }

                                        items.Add(value);
                                        ((ComboBox)t).Items.Add(name);

                                        if (defaultValue.Equals(value))
                                        {
                                            ((ComboBox)t).SelectedIndex = ((ComboBox)t).Items.Count - 1;
                                        }
                                    }

                                    if (description.Count > 0)
                                    {
                                        if (!String.IsNullOrEmpty(tooltip))
                                            tooltip += Environment.NewLine + Environment.NewLine;
                                        tooltip += "Available options:" + Environment.NewLine +
                                                   String.Join(Environment.NewLine, description);
                                    }
                                    t.Tag = items;

                                    // No default value match
                                    if (((ComboBox)t).SelectedIndex < 0)
                                    {
                                        ((ComboBox)t).DropDownStyle = ComboBoxStyle.DropDown;
                                        t.Text = defaultValue;
//.........这里部分代码省略.........
开发者ID:eried,项目名称:RPiCustomizer,代码行数:101,代码来源:FormEditor.cs

示例8: AddTable

        private void AddTable(string name, List<BasicTable.TableItem> items)
        {
            int row = 0;

            var panel = new TableLayoutPanel
            {
                ColumnCount = 2,
                RowCount = items.Count
            };

            panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 35));
            panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 65));
            // ReSharper disable ForCanBeConvertedToForeach
            for (int i = 0; i < items.Count; i++) // ReSharper restore ForCanBeConvertedToForeach
            {
                panel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
            }

            foreach (var item in items)
            {
                panel.Controls.Add(item.Control);
                panel.SetRow(item.Control, row);
                panel.SetColumn(item.Control, 1);

                if (string.IsNullOrEmpty(item.Name) == false)
                {
                    var label = new Label()
                    {
                        Text = string.Format(Properties.Localization.Editor_BasicTable_ItemLabelFormat, item.Name),
                        Dock = DockStyle.Fill,
                        AutoSize = true,
                        TextAlign = ContentAlignment.MiddleRight,
                    };
                    panel.Controls.Add(label);
                    panel.SetRow(label, row);
                    panel.SetColumn(label, 0);
                }
                else
                {
                    panel.SetColumnSpan(item.Control, 2);
                }

                if (item.Binding != null)
                {
                    item.Control.DataBindings.Add(item.Binding);
                }

                row++;
            }

            panel.AutoSize = true;
            panel.Dock = DockStyle.Fill;

            var group = new GroupBox();
            group.Text = name;
            group.MinimumSize = new Size(320, 0);
            group.AutoSize = true;
            group.Controls.Add(panel);

            this._PlayerBasicPanel.Controls.Add(group);
        }
开发者ID:bews,项目名称:Gibbed.MassEffect3,代码行数:61,代码来源:Editor.cs

示例9: set_TopDataColumn

        private void set_TopDataColumn(Dictionary<string, ColumnSetting> dcs, DataTable dt)
        {
            TopflowLayoutPanel.SuspendLayout();
            ColumnSetting cs = null;

            foreach (DataColumn dc in dt.Columns)
            {
                if (dcs.ContainsKey(dc.ColumnName) && dcs[dc.ColumnName].Visiable)
                {
                    cs = dcs[dc.ColumnName];
                    TableLayoutPanel tlp = new TableLayoutPanel();

                    tlp.RowCount = 1;
                    tlp.Parent = TopflowLayoutPanel;
                    tlp.Height = 32;
                    tlp.Show();

                    Label lleft = new Label();
                    lleft.Text = dcs[dc.ColumnName].HeadText;
                    lleft.Anchor = AnchorStyles.None;
                    lleft.AutoSize = true;
                    lleft.Show();

                    Control rtb = null;
                    if (cs.ReadOnly)
                    {
                        rtb = new Label() {  BorderStyle= System.Windows.Forms.BorderStyle.FixedSingle };
                    }
                    else
                    {
                        rtb = new TextBox();
                    }

                    rtb.DataBindings.Add(new Binding("Text", topbs, dc.ColumnName, true));
                    rtb.Width = dcs[dc.ColumnName].Width;
                    rtb.Anchor = AnchorStyles.Left;
                    tlp.ColumnCount = 2;

                    rtb.Show();

                    tlp.Controls.AddRange(new Control[] { lleft, rtb });
                    tlp.SetColumn(lleft, 0);
                    tlp.SetColumn(rtb, 1);

                    //start list data link
                    if (cs.LinkData && !cs.ReadOnly)    //列表数据类型
                    {
                        rtb.Tag = cs;
                        //这种委托不知道是否是共用,还是每个实例一个,待确定
                        MouseEventHandler rtb_right = delegate(object sender, MouseEventArgs e)
                        {
                            if (e.Button == MouseButtons.Left)
                            {
                                //弹出窗体对话框,用于选择数据
                                SelectItemValue siv = SelectItemValue.Default;
                                TextBox rtb_tmp = (TextBox)sender;
                                ColumnSetting cs_rtb = (ColumnSetting)rtb_tmp.Tag;

                                siv.Text = string.Format("选择 {0} ...", cs_rtb.HeadText);
                                siv.SetColumnSetting(_dblClass, cs_rtb, ModelName, cs_rtb.HeadText);
                                if (siv.ShowDialog() == DialogResult.OK)
                                {
                                    rtb_tmp.Text = siv.SelectValue;
                                }
                            }
                        };
                        rtb.MouseDoubleClick += rtb_right;

                        //tlp.ColumnCount = 3;
                        //ComboBox cb = new ComboBox();
                        //cb.Width = 20;
                        //cb.DropDownWidth = 200;
                        //cb.DropDownStyle = ComboBoxStyle.DropDownList;
                        //cb.TabIndex = 0;
                        //_dblClass.RefreshColumnSettingLinkData(ref _sqlcommand, dc.ColumnName); //更新数据
                        //cb.DataSource = cs.LinkDataTable;
                        //cb.DisplayMember = cs.LinkColumnName ;
                        ////cb.DataBindings.Add("Text", cs.LinkDataTable, "Value");
                        //EventHandler _Commit = delegate(object sender, EventArgs e)
                        // {
                        //     rtb.Text = cb.Text;
                        // };
                        //cb.SelectionChangeCommitted += _Commit;
                        //cb.Show();

                        //tlp.Controls.Add(cb);
                        //tlp.SetColumn(cb, 2);
                    }
                    //end list data link
                    tlp.AutoSize = true;
                    tlp.AutoSizeMode = AutoSizeMode.GrowAndShrink;
                }

                //有些列后添加的,但是需要显示,只是没有配置信息的情况
                //此情况未处理
            }
            TopflowLayoutPanel.ResumeLayout();
        }
开发者ID:fatbudy,项目名称:CSSM,代码行数:98,代码来源:Business.cs

示例10: AddControls

 private void AddControls()
 {
     List<Requirement> reqs = GetAllRequirements();
     panel.Controls.Clear();
     TableLayoutPanel pn = new TableLayoutPanel
     {
         Dock = DockStyle.Fill,
         RowCount = reqs.Count,
         ColumnCount = 2,
         AutoSize = true,
         AutoScroll = true,                ColumnStyles =
         {
             new ColumnStyle{Width=30,SizeType=SizeType.Percent},
             new ColumnStyle{Width=70,SizeType=SizeType.Percent},
             
         }
     };
     List<Control> labels = reqs.GenerateLabels();
     List<Control> ctrls = reqs.GenerateControls(Settings.Instance.GlobalMetadataDictionary);
     for (int x = 0; x < reqs.Count; x++)
     {
         pn.RowStyles.Add(new RowStyle { Height = 30, SizeType = SizeType.Absolute });
         pn.Controls.Add(labels[x]);
         pn.Controls.Add(ctrls[x]);
         pn.SetColumn(labels[x], 0);
         pn.SetRow(labels[x], x);
         pn.SetColumn(ctrls[x], 1);
         pn.SetRow(ctrls[x], x);
     }
     pn.RowStyles.Add(new RowStyle { Height = 1, SizeType = SizeType.Percent });
     Panel pp = new Panel
     {
         Dock = DockStyle.Fill,
     };
     pn.Controls.Add(pp);
     pn.SetColumn(pp,0);
     pn.SetRow(pp,reqs.Count);
     pn.SetColumn(pp,2);
     panel.Controls.Add(pn);
 }
开发者ID:maxpiva,项目名称:AnimeOfflineDownloader,代码行数:40,代码来源:Global.cs

示例11: LoadRooms

        private void LoadRooms(TabPage roomTypeTab)
        {
            try
            {

                long TypeID = ((RoomType)roomTypeTab.Tag).Typeid;
                KryptonPanel roomOutlinePane = new KryptonPanel();
                TableLayoutPanel roomLayoutPane = new TableLayoutPanel();

                RoomCollection mRoomColl = new RoomCollection();
                if (TypeID > -1)
                    mRoomColl.Where(Room.TypeidColumn.ColumnName, TypeID).Load();
                else
                    mRoomColl.Load();

                roomLayoutPane.RowCount = mRoomColl.Count >= 26 ? mRoomColl.Count - 1 : 25;
                roomLayoutPane.ColumnCount = 12;
                roomLayoutPane.Size = new Size(ROOM_BUTTON_WIDTH * roomLayoutPane.RowCount + 3, ROOM_BUTTON_HEIGHT * roomLayoutPane.ColumnCount + 3);

                int currRowIndex = 0; int currColIndex = 0;
                roomLayoutPane.SuspendLayout();
                foreach (Room room in mRoomColl)
                {
                    var roomButton = new KryptonButton
                    {
                        Name = ("RM" + room.Roomid),
                        Size = new Size(ROOM_BUTTON_WIDTH, ROOM_BUTTON_HEIGHT),
                        Text =
                            (room.Name.Trim().ToLowerInvariant().StartsWith("room")
                                 ? room.Name
                                 : "Room " + room.Name),
                        Tag = room
                    };

                    CreateRoomMenu(roomButton);
                    roomLayoutPane.Controls.Add(roomButton);
                    roomLayoutPane.SetRow(roomButton, currRowIndex);
                    roomLayoutPane.SetColumn(roomButton, currColIndex);

                    if (currColIndex == roomLayoutPane.ColumnCount)
                    {
                        currRowIndex++;
                        currColIndex = 0;
                    }
                    else
                    {
                        currColIndex++;
                    }
                }
                roomLayoutPane.ResumeLayout();
                roomLayoutPane.BackColor = Color.Transparent;
                roomOutlinePane.Dock = DockStyle.Fill;
                roomOutlinePane.Controls.Add(roomLayoutPane);
                roomTypeTab.Controls.Add(roomOutlinePane); //Add to Current Tab
            }
            catch (Exception ex) { }
        }
开发者ID:okyereadugyamfi,项目名称:okerospos,代码行数:57,代码来源:RoomCatalog.cs

示例12: RoundOverview

		public RoundOverview(int round, int count, int correct) {
			// TODO: Make theme-aware.
			correctCount.ForeColor = correctLabel.ForeColor = correctRatio.ForeColor = AnswerColors.Correct;
			incorrectCount.ForeColor = incorrectLabel.ForeColor = incorrectRatio.ForeColor = AnswerColors.Incorrect;

			base.Font = new Font(base.Font.FontFamily, base.Font.Size * 1.4f);
			FontFamily titleFontFamily = Array.Exists(FontFamily.Families, x => x.Name == "Cambria") 
				? new FontFamily("Cambria")
				: roundNo.Font.FontFamily;

			roundNo.Font = new Font(titleFontFamily, base.Font.Size * 2.0f, FontStyle.Bold);
			Disposed += delegate {
				Font.Dispose();
				roundNo.Font.Dispose();
			};
			
			prompt.ForeColor = SystemColors.GrayText;

			table = new TableLayoutPanel { RowCount = 4, ColumnCount = 3 }; 
			
			foreach (var label in new[] { roundNo, correctLabel, incorrectLabel, correctCount, incorrectCount, correctRatio, incorrectRatio, prompt }) {
				label.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Top;
				label.TextAlign = ContentAlignment.MiddleLeft;
				label.AutoSize = true;
				table.Controls.Add(label);
			}

			prompt.TextAlign = ContentAlignment.MiddleCenter;

			table.RowStyles.Add(new RowStyle(SizeType.AutoSize));
			table.RowStyles.Add(new RowStyle(SizeType.Percent, 0.5f));
			table.RowStyles.Add(new RowStyle(SizeType.Percent, 0.5f));
			table.RowStyles.Add(new RowStyle(SizeType.AutoSize));

			table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0f));
			table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
			table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));

			// Row 0: Header
			table.SetRow(roundNo, 0); 
			table.SetColumn(roundNo, 0);
			table.SetColumnSpan(roundNo, 3);

			// Row 1: Correct guesses
			table.SetRow(correctLabel, 1);
			table.SetRow(correctCount, 1);
			table.SetRow(correctRatio, 1);
			table.SetColumn(correctLabel, 0);
			table.SetColumn(correctCount, 1);
			table.SetColumn(correctRatio, 2);

			// Row 2: Incorrect guesses
			table.SetRow(incorrectLabel, 2);
			table.SetRow(incorrectCount, 2);
			table.SetRow(incorrectRatio, 2);
			table.SetColumn(incorrectLabel, 0);
			table.SetColumn(incorrectCount, 1);
			table.SetColumn(incorrectRatio, 2);

			// Row 3: Prompt
			table.SetRow(prompt, 3);
			table.SetColumn(prompt, 0);
			table.SetColumnSpan(prompt, 3);

			Controls.Add(table);

			Resize += delegate { Layout(); };

			UpdateScore(round, count, correct);
		}
开发者ID:dbremner,项目名称:szotar,代码行数:70,代码来源:Learn.cs

示例13: MainForm

        public MainForm()
        {
            InitializeComponent();

              dictCharts = new Dictionary<int, Chart[]>();
              signals = new Tuple<double[], double[]>[9];
              spectors = new List<Complex[]>();

              TableLayoutPanel tableLayoutPanel;
              // Создаем для трех отведений.
              for (int t = 0; t < 3; t++)
              {
            tableLayoutPanel = new TableLayoutPanel();
            tabControl.TabPages[t].Controls.Add(tableLayoutPanel);
            tableLayoutPanel.Dock = DockStyle.Fill;
            tableLayoutPanel.ColumnCount = 2;
            tableLayoutPanel.RowCount = 4;
            tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
            tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
            tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
            tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
            tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
            tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));

            Chart[] charts = new Chart[6];
            for (int i = 0; i < 6; i++)
            {
              int row = i < 3 ? i / 2 : (i + 1) / 2;
              int col = i < 3 ? i % 2 : (i + 1) % 2;

              Chart chart = charts[i] = CreateChart();
              tableLayoutPanel.Controls.Add(chart);
              tableLayoutPanel.SetRow(chart, row);
              tableLayoutPanel.SetColumn(chart, col);
              if ((i + 1) % 3 == 0)
              {
            tableLayoutPanel.SetColumnSpan(chart, 2);
              }
            }
            dictCharts[t] = charts;
              }

              // Создаем для остальных отведений.
              tableLayoutPanel = new TableLayoutPanel();
              tabControl.TabPages[3].Controls.Add(tableLayoutPanel);
              tableLayoutPanel.Dock = DockStyle.Fill;
              tableLayoutPanel.ColumnCount = 1;
              tableLayoutPanel.RowCount = 9;
              tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
              for (int i = 0; i < 9; i++)
              {
            tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100 / 9));
              }
              for (int i = 0; i < 9; i++)
              {
            Chart chart = CreateChart();
            tableLayoutPanel.Controls.Add(chart);
            tableLayoutPanel.SetRow(chart, i);
            tableLayoutPanel.SetColumn(chart, 0);
            dictCharts[3 + i] = new Chart[] { chart };

            chart.Titles.Add(new string[] { "AVR", "AVL", "AVF", "C1", "C2", "C3", "C4", "C5", "C6" }[i]);
            chart.Titles[0].Docking = Docking.Left;
              }

              EnableButtons(false);
        }
开发者ID:DarkGraf,项目名称:CapdEmulator,代码行数:67,代码来源:MainForm.cs

示例14: SetControl

 private void SetControl(TableLayoutPanel tb, Control con, int row, int col)
 {
     tb.Controls.Add(con);
     tb.SetRow(con, row);
     tb.SetColumn(con, col);
 }
开发者ID:lexzh,项目名称:Myproject,代码行数:6,代码来源:testcmd.cs

示例15: AppErrorDialog

        private AppErrorDialog()
        {
            if (!appErrorInitialized)
            {
                Application.EnableVisualStyles();
                appErrorInitialized = true;
            }

            string title = FL.AppErrorDialogTitle;
            string appName = FL.AppName;
            if (!string.IsNullOrEmpty(appName))
            {
                title = appName + " – " + title;
            }

            this.BackColor = SystemColors.Window;
            this.ControlBox = false;
            this.MinimizeBox = false;
            this.MaximizeBox = false;
            this.Font = SystemFonts.MessageBoxFont;
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.ShowInTaskbar = false;
            this.Size = new Size(550, 300);
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = title;
            this.TopMost = true;

            tablePanel = new TableLayoutPanel();
            tablePanel.Dock = DockStyle.Fill;
            tablePanel.RowCount = 6;
            tablePanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
            tablePanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
            tablePanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
            tablePanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
            tablePanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 0));
            tablePanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
            tablePanel.ColumnCount = 1;
            tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
            this.Controls.Add(tablePanel);

            introLabel = new Label();
            introLabel.BackColor = Color.FromArgb(221, 74, 59);
            introLabel.ForeColor = Color.White;
            introLabel.Dock = DockStyle.Fill;
            introLabel.AutoSize = true;
            introLabel.Font = new Font(
                SystemFonts.MessageBoxFont.FontFamily,
                SystemFonts.MessageBoxFont.SizeInPoints * 1.3f,
                SystemFonts.MessageBoxFont.Style);
            introLabel.MaximumSize = new Size(this.ClientSize.Width, 0);
            introLabel.Padding = new Padding(6, 4, 7, 6);
            introLabel.Margin = new Padding();
            introLabel.UseCompatibleTextRendering = false;
            introLabel.UseMnemonic = false;
            tablePanel.Controls.Add(introLabel);
            tablePanel.SetRow(introLabel, 0);
            tablePanel.SetColumn(introLabel, 0);

            errorPanel = new Panel();
            errorPanel.AutoScroll = true;
            errorPanel.Dock = DockStyle.Fill;
            errorPanel.Margin = new Padding(7, 8, 10, 6);
            errorPanel.Padding = new Padding();
            tablePanel.Controls.Add(errorPanel);
            tablePanel.SetRow(errorPanel, 1);
            tablePanel.SetColumn(errorPanel, 0);

            errorLabel = new Label();
            errorLabel.AutoSize = true;
            errorLabel.MaximumSize = new Size(this.ClientSize.Width - 20, 0);
            errorLabel.Padding = new Padding();
            errorLabel.Margin = new Padding();
            errorLabel.UseCompatibleTextRendering = false;
            errorLabel.UseMnemonic = false;
            errorPanel.Controls.Add(errorLabel);

            logLabel = new LinkLabel();
            logLabel.AutoSize = true;
            logLabel.MaximumSize = new Size(this.ClientSize.Width - 20, 0);
            logLabel.Margin = new Padding(8, 6, 10, 0);
            logLabel.Padding = new Padding();
            if (FL.LogFileBasePath != null)
            {
                logLabel.Text = string.Format(FL.AppErrorDialogLogPath, FL.LogFileBasePath.Replace("\\", "\\\u200B") + "*.fl");
                string dir = Path.GetDirectoryName(FL.LogFileBasePath).Replace("\\", "\\\u200B");
                logLabel.LinkArea = new LinkArea(FL.AppErrorDialogLogPath.IndexOf("{0}", StringComparison.Ordinal), dir.Length);
                logLabel.LinkClicked += (s, e) =>
                {
                    Process.Start(Path.GetDirectoryName(FL.LogFileBasePath));
                };
            }
            else
            {
                logLabel.Text = FL.AppErrorDialogNoLog;
                logLabel.LinkArea = new LinkArea(0, 0);
            }
            logLabel.UseCompatibleTextRendering = false;
            logLabel.UseMnemonic = false;
            tablePanel.Controls.Add(logLabel);
            tablePanel.SetRow(logLabel, 2);
//.........这里部分代码省略.........
开发者ID:modulexcite,项目名称:FieldLog,代码行数:101,代码来源:AppErrorDialog.cs


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