Results 1 to 3 of 3

Thread: [RESOLVED] [2008] Getting the cursorto jump to a specific line in a textbox

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Resolved [RESOLVED] [2008] Getting the cursorto jump to a specific line in a textbox

    Code:
    Dim Ask_ As Integer
    Try
    Ask_ = InputBox("Enter in the line you wish to go to.", "Go To", 1)
    Catch
    Msgbox("You must enter in a number!")
    End Try
    
    'Some code here? TxtText.SelectionStart = ?

    How could i make the cursor jump to the line that the user specified?

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2008] Getting the cursorto jump to a specific line in a textbox

    vb Code:
    1. TxtText.SelectionStart = TxtText.Text.IndexOf(TxtText.Lines(your number).ToString)
    2. TxtText.Focus()

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: [2008] Getting the cursorto jump to a specific line in a textbox

    Thanks dude. It worked =D.

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