Results 1 to 4 of 4

Thread: Quick registry lesson

  1. #1

    Thread Starter
    Addicted Member Smie's Avatar
    Join Date
    Jun 1999
    Location
    Columbus, OH
    Posts
    249

    Post

    how to i set a button to save what a text box says, and set a second button to display what was saved into the registry when the save button was pressed. I played around with the settings for a while and still cant understand....thanks

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    For this example I'm using the VB functions SaveSetting and GetSetting, the same rules would apply if you were using the APIs:

    On a Form with a Textbox and 2 Command Buttons..
    Code:
    Private Sub Command1_Click()
        'Save the Text to the Registry
        SaveSetting App.Title, "Test", "SavedText", Text1
    End Sub
    
    Private Sub Command2_Click()
        'Retrieve the Text from the Registry
        'Use "Nothing Saved." As a Default Value
        'If nothing is in the Registry.
        Text1 = GetSetting(App.Title, "Test", "SavedText", "Nothing Saved.")
    End Sub

    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    adyoung@win.bright.net

  3. #3
    Member
    Join Date
    Jan 1999
    Location
    Gig Harbor, WA, USA
    Posts
    48

    Post

    The problem with SaveSetting and GetSetting is that your application data is stored in a few VB subkeys, which is bad. You need to use SaveSetting[String/Long/DWord] and GetSetting[String/Long/DWord] to have complete control over the entire registry.

    ------------------
    (`..`->ShadowCrawler<-`..)
    Teenage Programmer
    Visual Basic, HTML, C++, JavaScript

    http://welcome.to/X12Tech
    Email: craigkovatch@compuserve.com
    ICQ#: 9872708

  4. #4
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    Take a look at this article on this site: http://www.vb-world.net/registry/registry2/

    It has what you need.

    ------------------
    Tom Young, 14 Year Old
    tyoung@stny.rr.com
    ICQ: 15743470
    AIM: TomY10
    PERL, JavaScript and VB Programmer

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