欢迎光临
我们一直在努力

获得光标在多行textbox中的行与列的函数-.NET教程,评论及其它

建站超值云服务器,限时71元/月

public function checkrow() as string

        dim row as integer = me.textbox1.selectionstart

        dim i as integer

        dim p as integer

        dim count as integer = 0

        dim count1 as integer = 0

        for i = 0 to me.textbox1.lines.getupperbound(0)

            count += me.textbox1.lines(i).length + 2 一个回车相当于2个

            if row <= count then

                if i = 0 then

                    p = row

                else

                    p = row – count1

                end if

                return “行:” & cstr(i) & “/列:” & cstr(p)

            end if

            count1 += me.textbox1.lines(i).length + 2

        next

    end function
赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 获得光标在多行textbox中的行与列的函数-.NET教程,评论及其它
分享到: 更多 (0)

相关推荐

  • 暂无文章