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
Printable View
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
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
[email protected]
[email protected]
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: [email protected]
ICQ#: 9872708
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
[email protected]
ICQ: 15743470
AIM: TomY10
PERL, JavaScript and VB Programmer