Foxtable(狐表)用户栏目专家坐堂 → 请教老师字符匹配标识要如何实现


  共有2222人关注过本帖树形打印复制链接

主题:请教老师字符匹配标识要如何实现

帅哥哟,离线,有人找我吗?
有点色
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/12/5 14:57:00 [显示全部帖子]

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
 

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目3.zip


 回到顶部