当前位置:编程学习 > C#/ASP.NET >>

为什么我的TableLayoutPanel里面没有单元格的线?

TableLayoutPanel tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
tableLayoutPanel.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
tableLayoutPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
tableLayoutPanel.ColumnCount = 2;
tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
tableLayoutPanel.Controls.Add(label1, 0, 0);
tableLayoutPanel.Controls.Add(textInputBox, 1, 0);
tableLayoutPanel.Controls.Add(label2, 0, 1);
tableLayoutPanel.Controls.Add(colorInputBox, 1, 1);
tableLayoutPanel.Controls.Add(label3, 0, 2);
tableLayoutPanel.Controls.Add(sizeInputBox, 1, 2);
tableLayoutPanel.Location = new System.Drawing.Point(140, 222);
tableLayoutPanel.Name = "tableLayoutPanel1";
tableLayoutPanel.RowCount = 5;
tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
tableLayoutPanel.Size = new System.Drawing.Size(200, 100);
tableLayoutPanel.Dock = DockStyle.Fill;
tableLayoutPanel.TabIndex = 0;

为什么我只看到表格外面的线,没有看到里面单元格的线,不知道如何设置 --------------------编程问答-------------------- up --------------------编程问答-------------------- 写那么多代码干嘛?一般都是设置border的问题!! --------------------编程问答-------------------- 这些代码不是我写的,是vs自动生成的,贴出来是看下。我也知道是border的问题,但是怎么设置?谢谢 --------------------编程问答-------------------- System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
试试是不是这个的原因,你换成其它的选项看看 --------------------编程问答--------------------
引用 4 楼 symbol441 的回复:
System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
试试是不是这个的原因,你换成其它的选项看看

            this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.None; --------------------编程问答--------------------   up一下下
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,