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


C# TableLayoutPanel.GetRow方法代码示例

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


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

示例1: SetRowValue

        private static void SetRowValue(TableLayoutPanel layoutPanel, Label label, string value)
        {
            if (!String.IsNullOrEmpty(value))
            {
                label.Text = value;
                layoutPanel.RowStyles[layoutPanel.GetRow(label)].SizeType = SizeType.AutoSize;
            }
            else
            {
                layoutPanel.RowStyles[layoutPanel.GetRow(label)].SizeType = SizeType.Absolute;
                layoutPanel.RowStyles[layoutPanel.GetRow(label)].Height = 0;
            }

            layoutPanel.AutoScroll = true;
        }
开发者ID:jonneale,项目名称:Egg,代码行数:15,代码来源:Profile.cs

示例2: 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

示例3: SetShaderState


//.........这里部分代码省略.........
                        node.Tag = i;

                        if (!filledSlot)
                            EmptyRow(node);

                        if (!usedSlot)
                            InactiveRow(node);
                    }
                    i++;
                }
            }
            cbuffers.EndUpdate();
            cbuffers.NodesSelection.Clear();
            cbuffers.SetVScrollValue(vs);

            vs = subs.VScrollValue();
            subs.BeginUpdate();
            subs.Nodes.Clear();
            {
                UInt32 i = 0;
                foreach (var subval in stage.Subroutines)
                {
                    subs.Nodes.Add(new object[] { i.ToString(), subval.ToString() });

                    i++;
                }
            }
            subs.EndUpdate();
            subs.NodesSelection.Clear();
            subs.SetVScrollValue(vs);

            {
                subs.Visible = subs.Parent.Visible = (stage.Subroutines.Length > 0);
                int row = table.GetRow(subs.Parent);
                if (row >= 0 && row < table.RowStyles.Count)
                {
                    if (stage.Subroutines.Length > 0)
                        table.RowStyles[row].Height = table.RowStyles[1].Height;
                    else
                        table.RowStyles[row].Height = 0;
                }
            }

            vs = readwrites.VScrollValue();
            readwrites.BeginUpdate();
            readwrites.Nodes.Clear();
            if (shaderDetails != null)
            {
                UInt32 i = 0;
                foreach (var res in shaderDetails.Resources)
                {
                    int bindPoint = stage.BindpointMapping.Resources[i].bind;

                    bool atomic = false;
                    bool ssbo = false;
                    bool image = false;

                    if (!res.IsReadWrite)
                    {
                        i++;
                        continue;
                    }

                    GLPipelineState.Buffer bf = null;
                    GLPipelineState.ImageLoadStore im = null;
                    ResourceId id = ResourceId.Null;
开发者ID:bobvodka,项目名称:renderdoc,代码行数:67,代码来源:GLPipelineStateViewer.cs

示例4: CollapseGroupBox

               // gb_init_heigh_percent : dung voi thu tu rowstyle cua TLP !!!!!
        static public void CollapseGroupBox(GroupBox collapse_gb , GroupBox[] other_gb, TableLayoutPanel TLP_Parent
            , int RowStyleIndex, UserControl UC, List<KeyValuePair<GroupBox,float>> gb_init_heigh_percent)
        {
            int CollapseSize = 30;
            int CollapsedGB = 1;        // so gb da collapse 
            int GBHeigh_Pixel = collapse_gb.Height;
            

            if (collapse_gb.Text.Contains("[+]"))    // Expand
            {
                for (int i = 0; i < gb_init_heigh_percent.Count; i++)
                {
                    TLP_Parent.RowStyles[i].SizeType = SizeType.Percent;

                    if (gb_init_heigh_percent[i].Key.Text.Contains("[-]") || i == RowStyleIndex) // gb dang expand hoac la gb duoc click
                    {
                        TLP_Parent.RowStyles[i].Height = gb_init_heigh_percent[i].Value;
                    }
                    else    // cac gb dang collapse
                    {
                        TLP_Parent.RowStyles[i].SizeType = SizeType.Absolute;
                        TLP_Parent.RowStyles[i].Height = CollapseSize;
                    }
                }
                collapse_gb.Text = collapse_gb.Text.Replace("[+]", "[-]");
            }
            else        // Collapse
            {
                for (int i = 0; i < other_gb.Length; i++)
                {
                    if (other_gb[i].Text.Contains("[+]"))
                    {
                        CollapsedGB++;
                    }
                }

                if (CollapsedGB < gb_init_heigh_percent.Count)   // o cho collapse gb cuoi cung
                {
                    TLP_Parent.RowStyles[RowStyleIndex].SizeType = SizeType.Absolute;
                    TLP_Parent.RowStyles[RowStyleIndex].Height = CollapseSize;

                    for (int i = 0; i < other_gb.Length; i++)
                    {
                        if (other_gb[i].Text.Contains("[-]"))      // cac gb dang expand
                        {
                            // (100% - (số gb đã collaspe * collapse size)) / ( so gb con lai - so gb đã collaspe = so gb chua collapse)
                            TLP_Parent.RowStyles[TLP_Parent.GetRow(other_gb[i])].SizeType = SizeType.Percent;
                            TLP_Parent.RowStyles[TLP_Parent.GetRow(other_gb[i])].Height += (100 - (CollapsedGB * CollapseSize)) / (other_gb.Length - CollapsedGB + 1);
                        }
                    }

                    for (int i = 0; i < other_gb.Length; i++)
                    {
                        if (other_gb[i].Text.Contains("[+]"))   // cac gb dang collapse
                        {
                            TLP_Parent.RowStyles[TLP_Parent.GetRow(other_gb[i])].SizeType = SizeType.Absolute;
                            TLP_Parent.RowStyles[TLP_Parent.GetRow(other_gb[i])].Height = CollapseSize;
                        }
                    }



                    collapse_gb.Text = collapse_gb.Text.Replace("[-]", "[+]");
                }

                
            }
        }
开发者ID:Fucmeo,项目名称:ou-qlns,代码行数:69,代码来源:Program.cs

示例5: killedPieces_MouseClick

        private void killedPieces_MouseClick(object sender, MouseEventArgs e)
        {
            if (pawnChangable)
            {
                Control c = (Control)sender;
                TableLayoutPanel teamBox = new TableLayoutPanel();
                if (currentState.getMyTeam() == (int)team.black)
                    teamBox = this.blackTeamPanel;
                else if (currentState.getMyTeam() == (int)team.white)
                    teamBox = this.whiteTeamPanel;

                int index = (teamBox.GetRow(c) * 2) + teamBox.GetColumn(c);
                if (gameboard.getDead(currentState.getMyTeam()).Count() > index)
                {
                    Piece currentPiece = gameboard.getDead(currentState.getMyTeam())[index];
                    if (gameboard.tradePawn(previousPiece, currentPiece))
                    {
                        if (gameboard.checkChessMate(currentState.getMyTeam()) == (int)moveResult.chessMate)
                        {
                            DialogResult result = MessageBox.Show("Chessmate! You win.\n\nPlay again?", "Chess - Message", MessageBoxButtons.YesNo);
                            promptNewGame(result);
                            return;
                        }
                        pawnChangable = false;
                        previousPiece = null;
                        AIOpponent.Move(gameboard, currentState);
                        updateBoard();
                        if (gameboard.checkChessMate(currentState.getOpponentTeam()) == (int)moveResult.chessMate)
                        {
                            DialogResult result = MessageBox.Show("Chessmate! You loose.\n\nPlay again?", "Chess - Message", MessageBoxButtons.YesNo);
                            promptNewGame(result);
                            return;
                        }
                    }
                }
            }
        }
开发者ID:mapplet,项目名称:Chess,代码行数:37,代码来源:game.cs


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