Re: Linecount in multiline textbox

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Feb 3, 3:34 pm, Jesper, Denmark
<JesperDenm...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
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.
.



Relevant Pages

  • Linecount in multiline textbox
    ... 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. ... What event do I need to hook up on if I want to be notified when the caret ... pos) of the caret in the string that the textbox shows? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: TextBox carret not placed correctly
    ... > When a user clicks a TextBox on a modal form, the caret immediately ... > the user's TextBox click sets the focus appropriately, ... This non modal form is a child form of the main window. ... CustomerProfileForm custForm=new CustomerProfileForm; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: TextBox carret not placed correctly
    ... > When a user clicks a TextBox on a modal form, the caret immediately ... > the user's TextBox click sets the focus appropriately, ... This non modal form is a child form of the main window. ... CustomerProfileForm custForm=new CustomerProfileForm; ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Dynamically created TextBox: Caret can be placed in middle of the blank area!
    ... But when I create a TextBox dynamically, the caret stays wherever I ... panelDocument is a Panel control. ... caret behaves as you described for the designer version. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Dynamically created TextBox: Caret can be placed in middle of the blank area!
    ... Jeannot wrote: ... When I create a TextBox in Designer, then at runtime wherever I click, ... But when I create a TextBox dynamically, the caret stays wherever I ...
    (microsoft.public.dotnet.languages.vb)