Add Row Dynamically in TableLayoutPanel

后端 未结 4 750
名媛妹妹
名媛妹妹 2020-12-14 00:29

\"enter

I want to add these entries dynamically row by row in TableLayoutPanel in Wind

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-14 00:55

    Here are a couple extension methods you can use:

    You can call them by doing the following:

    TableLayoutPanel tablePanel = new TableLayoutPanel(); //Initialize and do any other construction
    tablePanel.AddColumn(null, "Column1");
    tablePanel.AddRow(new RowStyle() { SizeType = SizeType.Absolute, Height = 50 }, "RowData1", "RowData2", "RowData3");
    
    public static int AddRow(this TableLayoutPanel table, RowStyle rowStyle = null, params string[] rowData)
    {
        List

提交回复
热议问题