Results 1 to 6 of 6

Thread: multiple text boxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    3

    multiple text boxes

    I have a Text file with 4 lines in the file, i want to display each line in seperate text boxes 1 text box for 1 line of text, iam new to this so sorry if i have not explained well any help would be great thanks

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: multiple text boxes

    Welcome to VB Forums!

    It would be easiest to do if your textboxes were part of a contro, array. What you would do would be to define a counter. Then use Line Input statement to read a line. each time you read the line move the input to a textbox(counter) and then increment the counter.

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: multiple text boxes

    eg

    VB Code:
    1. Dim ff As Integer
    2.     Dim strLine As String
    3.     Dim lngIndex As Long
    4.    
    5.     ff = FreeFile
    6.    
    7.     Open "C:\temp\four lines.txt" For Input As ff
    8.    
    9.     Do Until EOF(ff)
    10.         Line Input #ff, strLine
    11.         Text1(lngIndex).Text = strLine
    12.         lngIndex = lngIndex + 1
    13.     Loop

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    3

    Re: multiple text boxes

    Iam using the line input but the whole text file ends up in one text box
    could u please show am example thanks

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    3

    Re: multiple text boxes

    Thankyou very much this has help me out big time

  6. #6

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