Results 1 to 6 of 6

Thread: save several textboxs in 1 form and load into labels in other form. need help

  1. #1
    Stiletto
    Guest

    Question

    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

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    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.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    Stiletto
    Guest
    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?

  4. #4
    Stiletto
    Guest
    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?

  5. #5
    Stiletto
    Guest
    Um.. the code aint workin. Plz check the code and fix it

  6. #6
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    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

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

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