Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]文本框中选取的内容,怎么计算是第几到第几行

1楼
2425004926 发表于:2025/2/19 18:37:00
求助:文本框中选取的内容,怎么计算是第几到第几行
2楼
有点蓝 发表于:2025/2/20 8:45:00
Dim txt As WinForm.TextBox = Forms("窗口1").Controls("TextBox1")
Dim a As Integer = txt.SelectionStart
Dim b As Integer = txt.SelectionStart + txt.SelectionLength
Dim idx As Integer = 0
For i As Integer = 0 To txt.Lines.Length - 1
    idx += txt.Lines(i).Length + 2
    If idx >= a Then
        a = 99999
        Output.Show("起始行=" & i + 1)
    End If
    If idx >= b Then
        Output.Show("结束行=" & i + 1)
        Exit For
    End If 
Next 
3楼
2425004926 发表于:2025/2/20 12:16:00
太好了!高!谢谢老师!
4楼
2425004926 发表于:2025/2/20 13:07:00
测试后更改OK:If idx > a Then
共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02344 s, 2 queries.