ariel_au
April 15th, 2001, 05:17 AM
well, i have a .txt file called Names.txt
inside this .txt file i stored many names of fruits.
e.g
contents in this Names.txt file:
apple
orange
mango
banana
and i loaded the fruits names into a listbox called lstNames during form load at run-time.
during run-time i can delete away the selected fruit name in the listbox using the code:
private Sub cmdDelete_Click()
If lstNames.ListIndex >= 0 then
lstNames.RemoveItem lstNames.ListIndex
End If
End Sub
now, my problem is that, how can i delete the selected fruit name in the .txt file(Names.txt) as well?
inside this .txt file i stored many names of fruits.
e.g
contents in this Names.txt file:
apple
orange
mango
banana
and i loaded the fruits names into a listbox called lstNames during form load at run-time.
during run-time i can delete away the selected fruit name in the listbox using the code:
private Sub cmdDelete_Click()
If lstNames.ListIndex >= 0 then
lstNames.RemoveItem lstNames.ListIndex
End If
End Sub
now, my problem is that, how can i delete the selected fruit name in the .txt file(Names.txt) as well?