以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  字符换行  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=153021)

--  作者:cd_tdh
--  发布时间:2020/7/29 9:30:00
--  字符换行

老师,表格鼠标进入单元格显示该单元格的内容,系统默认只显示一行:

If e.Col.Name = "查看记录" AndAlso e.Row.IsNull("查看记录") = False Then
    e.Table.ShowToolTip(e.Row("查看记录"),e.Row,e.Col)
 End  If

 

当内容很长时,怎么让它换行显示呢?比如30个字符换一次行。

[此贴子已经被作者于2020/7/29 9:49:25编辑过]

--  作者:有点蓝
--  发布时间:2020/7/29 9:50:00
--  
If e.Col.Name = "查看记录" AndAlso e.Row.IsNull("查看记录") = False Then
    Dim s As String = e.Row("查看记录")
    If s.Length > 30 Then
        Dim s1 As String
        Do While s.Length > 30
            s1 = s1 & vbcrlf & s.SubString(0,30)
            s = s.SubString(30)
        Loop
        s1 = s1 & vbcrlf & s
        e.Table.ShowToolTip(s1.trim(vbcr,vblf),e.Row,e.Col)
    Else
        e.Table.ShowToolTip(s,e.Row,e.Col)
    End If
End  If