|
|
#1 (permalink) |
|
Monster Member
Join Date: Jan 2007
Location: .net 3.5 SP1
Age: 18
Posts: 2,402
Rep Power: 5
|
Code:
Open App.Path & "\test.txt" For Input As #1 just a personal project i have been wanting to do for a while finally getting around to it, anyone give me a hand?lets say we got Code:
Private Sub cmdOpen_Click() 'once i click this button, txtBox.text will change to the text in the file Test.text which will be in the same folder End Sub Private Sub Form_Load() txtBox.text = "" End Sub Private Sub txtBox_Change() 'yeah well this is where the text goes End Sub
__________________
;]
|
|
|
|
|
|
#2 (permalink) |
|
New Member
Join Date: Sep 2007
Posts: 6
Rep Power: 0
|
You don't need anything in the Change event of the textbox.. the change event fires as soon as the text inside the control is different.. you don't want that.
Basically, theres things called File Numbers. Without explaining it in too much detail, its like opening up a new stream. Code:
Private Sub cmdOpen_Click()
Dim fileNumber As Long
fileNumber = FreeFile() ' Get the next free file number
Open App.Path & "\test.txt" For Input As #fileNumber
txtBox.Text = Input(LOF(fileNumber), fileNumber) ' Load the text.
Close #fileNumber
End Sub
|
|
|
|


just a personal project i have been wanting to do for a while finally getting around to it, anyone give me a hand?


