窗口设置了Table系统样式代码:DataTables("窗口_Table1").SysStyles("CurrentRow").FontBold = True '选定行字体加粗
也设置了表样式
DataTables("窗口_Table1").AddUserStyle("样式1", Color.AntiqueWhite, Color.Black)
在Table的DrawCell事件中设置了代码:
If e.Col.Name = "第二列" Then
e.Style = "样式1"
End If
选定行后该行第二列的字体没有加粗,请教老师该怎么实现在设置了某列背景色的情况下,选定该行后,该行的字体加粗
DrawCell事件会覆盖SysStyles的用法。不建议混用,全部放到DrawCell事件好了
DrawCell事件:
If e.Col.Name = "第二列" Then
e.Style = "样式1"
End If
If e.row.index = e.table.rowsel Then
If e.Col.Name = "第二列" Then
e.Style = "当前行第二列样式"
else
e.Style = "当前行样式"
end if
End If