winform新手教程之五: 如何改变datagridview选中行的颜色
方法1: 通过属性编辑,选中datagridview, F4, 找到DefaultCellStyle属性, 如图:
![]()
修改成你需要的颜色!
方法2: 通过代码:
Private Sub dgvList_CellFormatting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgvList.CellFormatting
e.CellStyle.SelectionForeColor = e.CellStyle.ForeColor [提示]系统颜色都可以设置
End Sub
Related posts:

又是某的沙发。
[回复]