|
-
Mar 29th, 2006, 01:39 PM
#1
Thread Starter
Member
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
-
Mar 29th, 2006, 01:48 PM
#2
Hyperactive Member
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
-
Mar 29th, 2006, 01:51 PM
#3
Re: Still cant get the savesetting
 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:
'on frmHack
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If Check1.Value = vbChecked Then
SaveSetting "frmHack", "CheckBoxStatus", "Check1", "IsChecked"
Else
SaveSetting "frmHack", "CheckBoxStatus", "Check1", "IsNotChecked"
End If
End Sub
Now, I want to restore the last setting when frmHack is loaded again, so I would do
VB Code:
'on frmHack
Private Sub Form_Load()
Dim strCheckStatus As String
strCheckStatus = GetSetting("frmHack", "CheckBoxStatus", "Check1")
If strCheckStatus = "IsChecked" Then
Check1.Value = vbChecked
End If
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|