Linecount in multiline textbox

  • Thread starter Thread starter Jesper, Denmark
  • Start date Start date
J

Jesper, Denmark

Hi,

In case of an error in an input file, I inform the user which line in the
file (i.e. the string) were the file were encountered.

The user will then need to navigate to this line in the somewhat long text
file shown in a textbos (no word wrap). However he needs to count line
himself!!.

I would like a lable outside the textbox to show the line number on which
the caret is placed.

What event do I need to hook up on if I want to be notified when the caret
has changed, and how do I get the position (then I can count lines to this
pos) of the caret in the string that the textbox shows?

Thanx for your help. Very appreciated.
Jesper.
 
Hi,

In case of an error in an input file, I inform the user which line in the
file (i.e. the string) were the file were encountered.

The user will then need to navigate to this line in the somewhat long text
file shown in a textbos (no word wrap). However he needs to count line
himself!!.

I would like a lable outside the textbox to show the line number on which
the caret is placed.

What event do I need to hook up on if I want to be notified when the caret
has changed, and how do I get the position (then I can count lines to this
pos) of the caret in the string that the textbox shows?

Thanx for your help. Very appreciated.
Jesper.

You would have to handle KeyDown, to knwo when then arrow is used,
then y ou will need to update the label that displays the position.

I would look for a more editor oriented control though. The provided
TextBox looks kind of shortcoming for what you want.
 
Back
Top