Results 1 to 3 of 3

Thread: Save Check / Option Values!

  1. #1

    Thread Starter
    Addicted Member Appaq's Avatar
    Join Date
    Jul 2002
    Location
    Buzau | RO
    Posts
    179

    Save Check / Option Values!

    Hello 2 all...

    I have a form with 4 CheckBoxes and 4 Options...
    How can i save the value of the checkboxes ? For example the checkbox 1 and 3 they have the value 1... (checked). When i restart the program i want to be the same, 1 and 3 checked! please help me!
    skin

  2. #2
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141
    Use the SaveSetting and GetSetting functions to store and retrieve the values from the registry.
    VB Code:
    1. Private Sub Form_Load()
    2.     Check1.Value = GetSetting(App.EXEName, "Settings", "Check1", 0)
    3.     Check2.Value = GetSetting(App.EXEName, "Settings", "Check2", 0)
    4.     Check3.Value = GetSetting(App.EXEName, "Settings", "Check3", 0)
    5.     Check4.Value = GetSetting(App.EXEName, "Settings", "Check4", 0)
    6. End Sub
    7.  
    8. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    9.     SaveSetting App.EXEName, "Settings", "Check1", Check1.Value
    10.     SaveSetting App.EXEName, "Settings", "Check2", Check2.Value
    11.     SaveSetting App.EXEName, "Settings", "Check3", Check3.Value
    12.     SaveSetting App.EXEName, "Settings", "Check4", Check4.Value
    13. End Sub

  3. #3

    Thread Starter
    Addicted Member Appaq's Avatar
    Join Date
    Jul 2002
    Location
    Buzau | RO
    Posts
    179
    Thanx alot my friend!
    skin

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