Results 1 to 11 of 11

Thread: SendKeys command in a TextBox?

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2012
    Posts
    290

    SendKeys command in a TextBox?

    I'm trying to read a textfile line by line, because each line is a data for mi program (integer numbers).
    After reading each number, I want to add the number to a textbox and then send the "Enter" key to that textbox. Read the next number and send the enter key...

    I'm trying to do this but it seems there is some kind of error:

    Dim Nombre_Archivo As String = OpenFileDialog1.FileName
    Dim TextLine As String

    If System.IO.File.Exists(Nombre_Archivo) = True Then
    Dim ObjReader As New System.IO.StreamReader(Nombre_Archivo)

    Do While ObjReader.Peek() <> -1
    'TextLine = TextLine & ObjReader.ReadLine() & vbNewLine
    TEXTBOX_NumeroSalido.Focus()
    TextLine = ObjReader.ReadLine() & vbNewLine
    LISTBOX_Consejo.Items.Add(TextLine)
    TEXTBOX_NumeroSalido.Text = TextLine
    SendKeys.Send("{ENTER}")
    Loop

    'TextLine = ObjReader.ReadLine()
    'TextBox1.Text = TextLine


    End If
    Last edited by Jose_VB; May 3rd, 2013 at 08:18 AM.

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