Results 1 to 5 of 5

Thread: Reading Files

  1. #1
    Guest
    Hi all,

    I have a little prob wif my app. You see, I have a text box that lets users save a message even with multiline.

    Problem:
    I'm trying to load it into a label control but not sure how to go about doing it

    any help appreciated

    thanx

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Maybe something along the lines of

    Code:
        Open "c:\test\test.txt" For Input As #1
        
        Label1.Caption = Input(LOF(1), #1)
        
        Close #1
    Iain, thats with an i by the way!

  3. #3
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736

    Cool

    If I understand correctly, this code will set the caption of the label equal to the text in the field. This example uses the LostFocus event of the textbox, so as soon as you exit the text field the Label will change.

    Code:
    Private Sub Text1_LostFocus()
        Label1.Caption = Text1.Text
    End Sub
    Remember to set the width of your label and to set autosize and wordwrap to true.

    [Edited by jbart on 09-20-2000 at 07:01 AM]

  4. #4
    Guest
    Hi Jbart,

    i know you can use that but the file is changed using another program

  5. #5
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736

    Cool

    Great. Then the code that Iain (with an "i") posted should do the trick.


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