|
-
Dec 12th, 2002, 12:52 PM
#1
Thread Starter
Addicted Member
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
-
Dec 12th, 2002, 01:05 PM
#2
Frenzied Member
Well
1:
VB Code:
'save file
Open "C:\saved.svd" For Output As #1
Print #1, Text1.Text
Print #2, Text2.Text
Print #3, Text3.Text
Close #1
'Open File
Dim sData1, sData2, sData3 As String
Open "C:\saved.svd" For Output As #1
Line Input #1, sData1
Line Input #1, sData2
Line Input #1, sData3
Text1.Text = sData1
Text2.Text = sData2
Text3.Text = sData3
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.
-
Dec 12th, 2002, 01:08 PM
#3
Thread Starter
Addicted Member
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
-
Dec 12th, 2002, 01:14 PM
#4
Frenzied Member
you should have said that... 
VB Code:
'save file
CommonDialog1.ShowSave
Open CommonDialog1.Filename For Output As #1
Print #1, Text1.Text
Print #2, Text2.Text
Print #3, Text3.Text
Close #1
'Open File
CommonDialog1.ShowOpen
Dim sData1, sData2, sData3 As String
Open CommonDialog1.Filename For Input As #1
Line Input #1, sData1
Line Input #1, sData2
Line Input #1, sData3
Text1.Text = sData1
Text2.Text = sData2
Text3.Text = sData3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|