Click to See Complete Forum and Search --> : Quick registry lesson
Smie
Nov 6th, 1999, 09:11 AM
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
Aaron Young
Nov 6th, 1999, 09:29 AM
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..
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
ShadowCrawler
Nov 6th, 1999, 12:52 PM
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 (http://wwp.mirabilis.com/9872708)
Compwiz
Nov 7th, 1999, 11:09 AM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.