|
-
Feb 11th, 2005, 09:43 AM
#1
Thread Starter
Lively Member
Checkbox Registry Value Please Help
well after searching this forum, I tryed implementing some registry values for my programs, I ahve a problem tho, on form loads, it always ticks check1 box one when the registry's be saved as not ticked, please have a look
Saved to registry when prog closed
Code:
If Check1.Value = vbChecked Then
SaveSetting App.EXEName, "Preferences", "Ontop", "vbChecked"
End If
Form Load, get setting
Code:
If Check1.Value = GetSetting(App.EXEName, "Preferences", Ontop, "vbChecked") Then
Check1.Value = vbChecked
End If
if i close the program and have the checkbox unticked and re open it, it still gives the checkbox a tick, btw, its for a option in my prog to have the form always on top, I bet you guys will crack at it in seconds but im lost
Last edited by Shadows; Feb 11th, 2005 at 09:55 AM.
-
Feb 11th, 2005, 09:51 AM
#2
Frenzied Member
Re: Checkbox Registry Value Please Help
Save it as True or False rather than "vbChecked".
-
Feb 11th, 2005, 09:53 AM
#3
Re: Checkbox Registry Value Please Help
save the value directly:
Like David said...
SaveSetting App.EXEName, "Preferences", "Ontop", Check1.Value
Check1.Value = GetSetting( etc....
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Feb 11th, 2005, 09:54 AM
#4
Re: Checkbox Registry Value Please Help
If the checkbox in unchecked, you don't save any value to the registry, so the old value will still be there. You need to add an Else in you If statements.
-
Feb 11th, 2005, 09:54 AM
#5
Frenzied Member
Re: Checkbox Registry Value Please Help
Oops - sorry - save it as 0,1,or2
CheckBox control — 0 is Unchecked (default), 1 is Checked, and 2 is Grayed (dimmed).
-
Feb 11th, 2005, 09:54 AM
#6
Thread Starter
Lively Member
Re: Checkbox Registry Value Please Help
Save
Code:
SaveSetting App.EXEName, "Preferences", "Ontop", Check1.Value
Retrieve (form load)
Code:
Check1.Value = GetSetting(App.EXEName, "Preferences", "Ontop", "vbChecked"
thank you!, this forum is a blessing, I cant thank you enough
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
|