Results 1 to 4 of 4

Thread: Getting line number from a textbox.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2001
    Posts
    26

    Thanks, but...

    Thanks for that, but it didn't work.

    EM_GETLINECOUNT is empty if that helps.

    I've only got VB5 mind, does that use VB6 stuff?

  2. #2

    Thread Starter
    Junior Member
    Join Date
    May 2001
    Posts
    26

    Question I've thought of a way of doing it!

    I've thought of a way of doing it, its pritty simple.

    I take whats left of the .selstart, and check how many carrage returns there are.

    The problem is I dont know how to check for how many carrage returns there are.

  3. #3
    Matthew Gates
    Guest
    I didn't notice that you were using the RichTextBox Control.
    Here is the simplest way to tell what line the cursor is on.


    VB Code:
    1. Private Sub RichTextBox1_Change()
    2.     'Add 1 so that it starts on line 1 instead of line 0
    3.     Caption = RichTextBox1.GetLineFromChar(RichTextBox1.SelStart) + 1
    4. End Sub

  4. #4

    Thread Starter
    Junior Member
    Join Date
    May 2001
    Posts
    26
    Cheers dude, works great!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width