Results 1 to 3 of 3

Thread: How do i get line1 from my text file and put it in a textbox?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2002
    Posts
    1

    How do i get line1 from my text file and put it in a textbox?

    How do i take line1 from my textbox and put it into my textbox

    please help me

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    This will get the first line from Text1 and set the text of Text2 to that line:
    VB Code:
    1. Dim firstline As String
    2. firstline = Mid$(Text1.Text, 1, InStr(1, Text1.Text, vbNewLine) - 1)
    3. Text2.Text = firstline
    Baaaaaaaaah

  3. #3
    Hyperactive Member
    Join Date
    May 2002
    Location
    Chicago
    Posts
    271
    This will get the first line from a sequential text file.
    Code:
    Private Sub Command1_Click()
      Dim MyString
      Dim FileNum As FreeFile
      Open "YourTextFile.txt" For Input As #FileNum
        Input #FileNum, MyString
      Close #FileNum
      Text1 = MyString
    End Sub
    Sometimes what you're looking for is exactly where you left it.

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