如何在True DBGrid Pro 7.0中将行的背景色设置成间隔的不同颜色?如何根据行中某个字段的值来决定本行的背景色?
解决方案 »
- 关于VB树型菜单如何来实现
- VB替换地址栏参数的问题
- 打包问题:我编译了一个exe的小程序,里面用到了MSChart和DTPicker和FileSystemObjec的东西,在别的机器上无法运行!!
- 和access数据库连接成功,但是text的文本框中只有第一次数据记录显示.adodc控件的各个按钮都无法使用
- vb将查询结果导出到Excel问题
- 如何求反余弦
- 如何调用API函数才能一次打开多个文件夹
- 怎么判断某个路径是否有指定的文件?
- 关于数据库的问题?(一定给高分的)
- 怎样编辑图标
- 当前屏幕上最上层活动的是一个对话框,我如何获得他并给他的“确定”按钮发送消息?
- 请问:如何获得一个未知数组的最大下标和最小下标????在线等待。
Dim st As Style
Set st = grdPT.Styles.Add("TEST")
With st
.Parent = "Normal"
.Font.Bold = True
.BackColor = vbWhite
.ForeColor = vbBlack
End With
Set st = grdPT.Styles.Add("SP")
With st
.Parent = "Normal"
.Font.Bold = True
.BackColor = &HC0FFC0
.ForeColor = vbBlack
End With
Set st = grdPT.Styles.Add("WA")
With st
.Parent = "Normal"
.Font.Bold = True
.BackColor = &HC0C0FF
.ForeColor = vbBlack
End With
Set st = grdPT.Styles.Add("red")
With st
.Parent = "normal"
.Font.Bold = True
.BackColor = &HFF8080
.ForeColor = &H80000018
End With
Set st = grdPT.Styles.Add("ok")
With st
.Parent = "normal"
.Font.Bold = True
.BackColor = &HFFC0C0
.ForeColor = vbBlack
End With
grdPT.FetchRowStyle = True
Private Sub grdpt_FetchRowStyle(ByVal Split As Integer, Book As Variant, ByVal RowStyle As TrueOleDBGrid70.StyleDisp)
Dim a As String
If Trim(grdPT.Columns("某个字段").CellText(Book)) = "某个内容" Then
RowStyle = "red"
End If
If Trim(grdPT.Columns("某个字段").CellText(Book)) = "某个内容" Then
RowStyle = "test"
End If
If Trim(grdPT.Columns("某个字段").CellText(Book)) = "某个内容" Then
RowStyle = "wa"
End If
If Trim(grdPT.Columns("某个字段").CellText(Book)) = "某个内容" Then
RowStyle = "sp"
End If
If Trim(grdPT.Columns("某个字段").CellText(Book)) = "某个内容" Then
RowStyle = "ok"
End If
End Sub