CodeItBetter Programming Another VB Programming Blog

How to Load a File To Text Box

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
'Controls - How to Load a File To Text Box

Option Explicit
 
'Add a Text Box to your form. Set the Text Box MultiLine property to True and Insert the following code:

Private Sub Form_Load()
    Dim sFile As String
    sFile = "c:\autoexec.bat"
    Open sFile For Input As #1
    Text1.Text = Input(LOF(1), #1)
    Close #1
End Sub

Related posts:

  1. How to Print a Text file
  2. How to print a text file with its default printer
  3. How to Remove all empty lines from the text file
  4. How to load a text file into list box for a given file name
  5. How to delete a line for a given line number from a text file
  6. How to write text in a given text file (in three ways)
  7. How to add contents of text file to a list box
  8. How to search for a string in a text file if found, display that line to the user.
  9. How to I create a text file from part of another text file (for given line numbers like Line No. 2 to 7)
  10. How to Search & delete a string in text File

Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.