Results 1 to 3 of 3

Thread: How put txt file lines into txtbox

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    2

    Question How put txt file lines into txtbox

    Hello

    I have a little problem with VisualBasic 6.0.
    I try to read data from txt file and put into txtBox.

    So in case i fill fields (Name, Title,Phone,Address) and press Add then data will save in c:/txt.txt on the first 4 lines. If i do it again then data will save for following 4 lines in C:/Text.txt and so on.
    I have already done a part where i can add data into txt file

    VisualBasic code:

    Private Sub Add_Click()
    Open "C:\Text.txt" For Append As #1
    Print #1, txtName.Text
    txtName.Text = ""
    Print #1, txtTitle.Text
    txtTitle.Text = ""
    Print #1, txtPhon.Text
    txtPhone.Text = ""
    Print #1, txtAadress.Text
    txtAadress.Text = ""
    Close #1
    End Sub

    My questions are.

    How can i view txt file lines in the txtboxes(txtName, txtTitle,txtPhone,txtAddress). If i will press View i will have to see the first 4 lines and if i do it again i will see 4 more lines and so on.
    When i will press delete how can i delete the first 4 lines... and the following 4 lines and so on in the text file

    VisualBasic form Object name C:/Text.txt

    Name : ______.........txtName..........1 Marek ..........-Name
    Title:________..........txtTitle............2 Mr.................-Title
    Phone:_______....... txtPhone.........3 052454102...-Phone
    Address: _____........txtAddress.......4 Home...........-Address
    .........................................................5 Kuslap..........-Name
    Add............................cmdAdd...........6 Mr................-Title
    View...........................cmdVie............7 521545566...-Phone
    Delete........................cmdDelete.......8 jungle..........-Address

    Pleace Help me! I need solution!
    All the best
    Last edited by tultsik; Apr 22nd, 2004 at 05:45 PM.

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