Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rich TextBox Ctrl
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00501736
Message ID:
00502899
Views:
18
>Hi,
>
>I'm looking for the simpliest way to get the line number where is located my cursor in a Rich textbox control?
>
>Any suggestion would be appreciate.
>
>Thanks
>
>Luc

Luc I didnt see any property for it but you can try this... I tried it in the DoubleClick method of a richtext control.
LOCAL lnCursorPos, lnChars
LOCAL lnLines, laLines[1], i, lcLine, lnLineLength
lnCursorPos = this.selstart
lnChars = 0
lnLines = ALINES(laLines,This.Text)
FOR i = 1 to lnLines
	lcLine = laLines[i]
	* MESSAGEBOX(lcline)
	lnLineLength = LEN(lcLine)
	lnChars = lnChars + lnLineLength
	* MESSAGEBOX(lnLineLength)
	IF lnCursorPos 		* MESSAGEBOX("Cursor is positioned on line " + ALLTRIM(STR(i)))
		EXIT
	ENDIF
ENDFOR
RETURN i  && line number
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform