Load to textbox:[resolved]
Heres my code for a little text editor:
VB Code:
Option Explicit
Dim ff As Integer
Dim sInput As String
Dim stRfile As String
Dim foundpos As Integer
Dim strLine As String
Private Sub Load_Click()
sInput = InputBox("Load file name:")
If StrPtr(sInput) = 0 Then
Print vbNullString
ElseIf StrPtr(sInput) <> 0 And sInput = "" Then
MsgBox "Please type a filename!"
Else
stRfile = sInput & ".txt"
ff = FreeFile()
Open stRfile For Input As #ff 'open text
End If
End Sub
Private Sub Save_As_Click()
ff = FreeFile()
sInput = InputBox("Save file as:")
If StrPtr(sInput) = 0 Then
Print vbNullString
ElseIf StrPtr(sInput) <> 0 And sInput = "" Then
MsgBox "Please type a filename!"
Else
Open sInput & ".txt" For Output As #ff
Print #ff, Text1.Text
Close #ff
End If
End Sub
how do i load the file i just found into my text1.text?
Re: Load to textbox:[resolved]