1、
Private Sub DataGridView1_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs) Handles DataGridView1.CellFormatting '保持选定单元格前景色不变 e.CellStyle.SelectionForeColor = e.CellStyle.ForeColor End Sub