mark 高亮查找
If e.Col.name = "产品功效" Then
Dim drs = DataTables("禁用词").Select("")
Dim cval As String = e.Row(e.Col.Name)
e.text = ""
Dim g As Graphics = e.Graphics
Dim fnt As New Font("宋体",e.Table.Font.Size, FontStyle.Bold)
Dim x As Integer = e.x + 1
Dim y As Integer = e.Y + 1
Dim idx As Integer = 0
Do While idx > -1
idx = -1
Dim val As String = ""
For Each dr As DataRow In drs
Dim v = dr("禁用词")
Dim i = cval.IndexOf(v)
If i > -1 Then
If idx = -1 Then
idx = i
val = v
ElseIf i < idx Then
idx = i
val = v
End If
End If
Next
If idx > -1 Then
Dim temp As String = cval.SubString(0,idx)
g.DrawString(temp,e.Table.Font,Brushes.black, x, y)
x += g.MeasureString(temp, e.Table.Font).width-3
g.DrawString(val,fnt,Brushes.Red, x, y)
x += g.MeasureString(val, fnt).width-1
cval = cval.SubString(idx+Val.Length)
End If
Loop
g.DrawString(cval,e.Table.Font,Brushes.black, x, y)
End If