Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitlePersist text in the Registry
Keywordsregistry, text, save, restore
CategoriesTips and Tricks
 
In the Form_Load event handler, load the saved text into a TextBox using GetSetting.

In the Form_Unload event handler, save the text using SaveSetting.

 
' Load the saved value from the registry.
Private Sub Form_Load()
    txtPersisted.Text = GetSetting(APP_NAME, SECTION_NAME, _
        "txtPersisted", "")
End Sub

' Save the value in the registry.
Private Sub Form_Unload(Cancel As Integer)
    SaveSetting APP_NAME, SECTION_NAME, "txtPersisted", _
        txtPersisted.Text
End Sub
 
This method saves the text in the key HKEY_CURRENT_USER\Software\VB and VBA Program Settings\PersistText\SavedValues.
 
 
Copyright © 1997-2001 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated