Results 1 to 6 of 6

Thread: Checkbox Registry Value Please Help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Location
    UK
    Posts
    119

    Resolved 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.

  2. #2
    Frenzied Member David.Poundall's Avatar
    Join Date
    Sep 2002
    Location
    Robin Hood Land
    Posts
    1,457

    Re: Checkbox Registry Value Please Help

    Save it as True or False rather than "vbChecked".
    David

    Learn the Rules so that you know how to break them properly.

    Printing dll dBTools MZTools Winsock API WinsockVB More Winsock SGrid2 MSChart Mail2Web

    If you have found this thread useful then read this

  3. #3
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    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"

  4. #4
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    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.
    Frans

  5. #5
    Frenzied Member David.Poundall's Avatar
    Join Date
    Sep 2002
    Location
    Robin Hood Land
    Posts
    1,457

    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).
    David

    Learn the Rules so that you know how to break them properly.

    Printing dll dBTools MZTools Winsock API WinsockVB More Winsock SGrid2 MSChart Mail2Web

    If you have found this thread useful then read this

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2004
    Location
    UK
    Posts
    119

    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
  •  



Click Here to Expand Forum to Full Width