|
-
Apr 8th, 2001, 03:40 PM
#1
Yo all wasup
i need help.. i'm makin a prog kinda like a games board/desktop.
the user can add a game: he puts game's name, icon, and exe path in one form (Ex: AddGame.frm).
When he opens the prog again i want it to load the games data like he typed in to a diffrent form.
So..i need a code to save the info into file(s) (One file is better ) and to save the icon or icon path.
and a way/code to load all the data back.
plz help. tnx folks
-
Apr 8th, 2001, 04:34 PM
#2
Use :
Code:
SaveSetting MyApp, MySettings, Text1, text1.text
SaveSetting MyApp, MySettings, Text1, text2.text
To save the text from text1 and text2 textboxes into the registry, so you'll probably want to place this under the Form_Unload() event for when the user closes the form.
To get these values back the next time the program's loaded, use the Getsetting option to retrieve these settings from the registry :
Code:
Private Sub Form_Load
Text1.text = GetSetting(MyApp, MySettings, Text1)
Text2.text = GetSetting(MyApp, MySettings, Text1)
End Sub
I've done a sample that'll copy values from serval text boxes values on one form, to another form which is attached below : 
Lastly, how are you doing the icon part ?
Is this loaded into a piicturebox, taken from the forms icon or is this a string which points to the folder / icon file on the PC ?
Last edited by alex_read; Apr 9th, 2001 at 03:24 AM.
-
Apr 8th, 2001, 05:07 PM
#3
yes, the icon is loaded into a picturebox after the user typed the icon's path into a textbox or browsed folders
how can u help me with this one?
-
Apr 8th, 2001, 05:19 PM
#4
but what if i need to save/load 3 textboxes per game (the prog can contain 10 games max, so every game has his own name,icon,exe)
is the savesetting/getsetting will be good for that kind of function?
-
Apr 9th, 2001, 12:11 AM
#5
Um.. the code aint workin. Plz check the code and fix it
-
Apr 9th, 2001, 03:27 AM
#6
I would use a database to save this information then, as an Access table can hold pictures as well as text.
If you've not worked with databases before, look at this thread :
http://forums.vb-world.net/showthrea...t=opendatabase
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
|