Results 1 to 3 of 3

Thread: Still cant get the savesetting

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    56

    Arrow Still cant get the savesetting

    I know i must be stupid here but i dont understand this saveserring, getsetting command. I know that you use the following:

    savesetting app.exename, "Settings", "Username", text1.txt

    if i were to make an application called Musicluva would my code line be:

    savesetting musicluva.exe, "settings", "Username", text1.txt

    or something else? Is there anyway of testing it without having to make exe first???

    What would my getsetting code line be. Please help.

    if anyone could make an example and e-mail it to me. Just something simple with saving and geting in it i would be must appreciative.

    Thanks in advance

  2. #2
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    468

    Re: Still cant get the savesetting

    The first parameter isn't the .exe it's just the applications name - as a string. You don't need to create an .exe to test it.

    These are from the on-line MSDN:

    SaveSetting
    GetSetting

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Still cant get the savesetting

    Quote Originally Posted by Musicluva19
    I know i must be stupid here but i dont understand this saveserring, getsetting command. I know that you use the following:

    savesetting app.exename, "Settings", "Username", text1.txt

    if i were to make an application called Musicluva would my code line be:

    savesetting musicluva.exe, "settings", "Username", text1.txt

    or something else? Is there anyway of testing it without having to make exe first???

    What would my getsetting code line be. Please help.

    if anyone could make an example and e-mail it to me. Just something simple with saving and geting in it i would be must appreciative.

    Thanks in advance
    This can easily be tested in design right from the IDE.

    Here is a generic example. Lets say I have a Form called frmHack. On frmHack there is a checkbox. If the checkbox gets checked, I want it to always be checked everytime frmHack is loaded or until it gets unchecked. I would do something like:
    VB Code:
    1. 'on frmHack
    2. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    3. If Check1.Value = vbChecked Then
    4.     SaveSetting "frmHack", "CheckBoxStatus", "Check1", "IsChecked"
    5. Else
    6.     SaveSetting "frmHack", "CheckBoxStatus", "Check1", "IsNotChecked"
    7. End If
    8. End Sub
    Now, I want to restore the last setting when frmHack is loaded again, so I would do
    VB Code:
    1. 'on frmHack
    2. Private Sub Form_Load()
    3. Dim strCheckStatus As String
    4. strCheckStatus = GetSetting("frmHack", "CheckBoxStatus", "Check1")
    5. If strCheckStatus = "IsChecked" Then
    6.    Check1.Value = vbChecked
    7. End If
    8. End Sub

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