Home » VB.NetRSS

RichTextbox - Get the cursor line position

Hi,

How to get the line number where the cursor is in a RichTextBox? I'm using VB 2010

Thanks!

Tim Visee

(Translated with google translate)
www.t-soft.nl
 

2 Answers Found

 

Answer 1

Try this.

 

Dim LineCurosorIsIn AsInteger = RichTextBox1.GetLineFromCharIndex(RichTextBox1.GetFirstCharIndexOfCurrentLine)

 

 

 

 

Answer 2

Thanks.

This is indeed the solution.

Dim
 LineCurosorIsIn AsInteger
 = RichTextBox1.GetLineFromCharIndex(RichTextBox1.GetFirstCharIndexOfCurrentLine)

 


Warning!
When you get to warp let alone the options of the RichTextBox and a line  is too long and get into two lines. Word is the second part of the rule as a rule included. It is useful to get warp set to false!

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter