2011-05-17 52 views

回答

7

您必須訂閱CellPaint事件。 作爲一個例子:

private void tableLayoutPanel_CellPaint(object sender, TableLayoutCellPaintEventArgs e) 
    { 
     if (e.Row == 0 && e.Column == 1) 
     { 
      e.Graphics.FillRectangle(new SolidBrush(Color.Black), e.CellBounds); 
     } 
    } 
+2

變化'e.ClipRectangle'到'e.CellBounds',這將是正確的答案;)(ClipRectangle指整個面板) – digEmAll 2011-05-17 13:19:04

+0

@digEmAll,謝謝你的建議。發佈編輯。 +1 – 2011-05-17 13:35:04

+0

謝謝,很棒的工作!!!!!!!!! – gooteis 2011-05-17 14:24:51

相關問題