DataGridView 行數不足時,底部空白區域顯示灰色背景(ControlDark),影響美觀。
dataGridView1.BackgroundColor = Color.White; // 或 Color.Transparent
RowPostPaint/CellPainting 事件。Background="Transparent" 或 RowBackground/AlternatingRowBackground。DataGridView 控件樣式完整指南 —— 涵蓋列標題、行、單元格、選中、邊框、網格線等所有可視屬性。
EnableHeadersVisualStyles = false 後才能自定義表頭樣式。VirtualMode) 下背景色需在 CellValueNeeded 同步設置。