用TableLayoutPanel画了个表格,想把边框色改成黑色的
没找到属性改边框色

解决方案 »

  1.   

     在tableLayoutPanel控件的CellPaint事件里重新绘制,代码如下: private void tableLayoutPanel1_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
            {
                // 单元格重绘
                Pen pp = new Pen(Color.Red);
                e.Graphics.DrawRectangle(pp, e.CellBounds.X, e.CellBounds.Y, e.CellBounds.X + e.CellBounds.Width - 1, e.CellBounds.Y + e.CellBounds.Height - 1);  
            }
      

  2.   

    重写tableLayoutPanel控件的CellPaint事件