Results 1 to 4 of 4

Thread: a few questions need answering

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    England
    Posts
    242

    Question a few questions need answering

    1) how do i save and open form textboxs into and from a file? what i want is, the user type in loads of info into loads of different boxes (about 10) then they can use the save as command to save the work, and then next time they open the program they can open that file and it will put all the info into the textboxs again.

    2) What *Exact* code do i have to use for the browse button? the user clicks browse then it brings up the box with all the files in (i want them to search for any type of image) they click on one then click open, and it places the name of the file they clicked into the textbox (you know what i want dont ya?)

    3) what do i need to use to the help files and make my program into .exe? cos ive got the "Model Working Edition" and i cant read help files or save my program as .exe
    Lpeek

  2. #2
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    Well

    1:
    VB Code:
    1. 'save file
    2. Open "C:\saved.svd" For Output As #1
    3. Print #1, Text1.Text
    4. Print #2, Text2.Text
    5. Print #3, Text3.Text
    6. Close #1
    7.  
    8. 'Open File
    9. Dim sData1, sData2, sData3 As String
    10. Open "C:\saved.svd" For Output As #1
    11. Line Input #1, sData1
    12. Line Input #1, sData2
    13. Line Input #1, sData3
    14. Text1.Text = sData1
    15. Text2.Text = sData2
    16. Text3.Text = sData3
    17. Close #1

    2:
    Use the CommonDialog control, browse for it in "Components"
    i think its exact name is "Microsfot Commondialog Control" or somethingg like that, if you cant figure it out, do a search for it on the forums

    3:
    Buy Visual Basic

    Hope that helped you !

    Cheers !
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    England
    Posts
    242
    on the open and save bits, what do i have to do? cos i want it so it saves as the filename that the user put in from the SaveAs dialog box
    Lpeek

  4. #4
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    you should have said that...
    VB Code:
    1. 'save file
    2. CommonDialog1.ShowSave
    3. Open CommonDialog1.Filename For Output As #1
    4. Print #1, Text1.Text
    5. Print #2, Text2.Text
    6. Print #3, Text3.Text
    7. Close #1
    8.  
    9. 'Open File
    10. CommonDialog1.ShowOpen
    11. Dim sData1, sData2, sData3 As String
    12. Open CommonDialog1.Filename For Input As #1
    13. Line Input #1, sData1
    14. Line Input #1, sData2
    15. Line Input #1, sData3
    16. Text1.Text = sData1
    17. Text2.Text = sData2
    18. Text3.Text = sData3
    19. Close #1
    Put a Commondialog box on your form, and that shoudl do the tricck
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

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