顶2楼,很实用,更易区分内容,建议列入帮助。按2楼修改的通用代码:
Dim paint As Boolean
Dim cname As String =CurrentTable.Cols(CurrentTable.ColSel).name
With CurrentTable
.Sort = cname ’ 或降序:.Sort = cname & " desc"
For i As Integer = 1 To .Rows.Count -1
If .Rows(i)(cname) <> .Rows(i-1)(cname) Then
paint = Not paint
End If
If paint Then
.SetHeaderCellBackColor(cname,Color.Cyan,i+1)
Else
.SetHeaderCellBackColor(cname,Color.Gold,1) ‘换一种底色
.SetHeaderCellBackColor(cname,Color.Gold,i+1)
End If
Next
End With
[此贴子已经被作者于2018/4/1 12:43:16编辑过]