Results 1 to 38 of 38

Thread: Load to textbox:[resolved]

Threaded View

  1. #1

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Resolved Load to textbox:[resolved]

    Heres my code for a little text editor:
    VB Code:
    1. Option Explicit
    2. Dim ff As Integer
    3. Dim sInput As String
    4. Dim stRfile As String
    5. Dim foundpos As Integer
    6. Dim strLine As String
    7.  
    8. Private Sub Load_Click()
    9.  
    10.    sInput = InputBox("Load file name:")
    11.    
    12.    If StrPtr(sInput) = 0 Then
    13.       Print vbNullString
    14.    ElseIf StrPtr(sInput) <> 0 And sInput = "" Then
    15.       MsgBox "Please type a filename!"
    16.    Else
    17.       stRfile = sInput & ".txt"
    18.        ff = FreeFile()
    19.             Open stRfile For Input As #ff 'open text
    20.                    
    21. End If
    22. End Sub
    23.  
    24. Private Sub Save_As_Click()
    25. ff = FreeFile()
    26.  
    27.    sInput = InputBox("Save file as:")
    28.    
    29.    If StrPtr(sInput) = 0 Then
    30.       Print vbNullString
    31.    ElseIf StrPtr(sInput) <> 0 And sInput = "" Then
    32.       MsgBox "Please type a filename!"
    33.    Else
    34.       Open sInput & ".txt" For Output As #ff
    35.       Print #ff, Text1.Text
    36.       Close #ff
    37.    End If
    38. End Sub

    how do i load the file i just found into my text1.text?
    Last edited by |2eM!x; Feb 4th, 2005 at 01:05 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