Take the cursor in multi-line TEXTBOX lines and columns

xiaoxiao2021-03-06  22

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 'One Enter is equivalent to 2

If row <= count then

IF i = 0 THEN

P = row

Else

P = ROW - Count1

END IF

Return "line:" & CSTR (i) & "/ column:" & CSTR (P)

END IF

Count1 = Me.TextBox1.Lines (i) .length 2

NEXT

END FUNCTION

转载请注明原文地址:https://www.9cbs.com/read-43142.html

New Post(0)