Search Tools Links Login

Very simple way to save your program settings!


Visual Basic 6, or VB Classic

This is very, very simple.. This is the easiest way to save a save a setting, besides using Print to text file.. it can be useful to save from and load to text boxes, dropdowns, listboxes, what have you.. because of its simplicity i dont expect votes.. its just a small piece of code.. but vote if you want to... thanks, enjoy!

Original Author: RyanConard

Code

'This code is very, very simple..
'I dont care if you vote on it or not..
'just enjoy it..
Private Sub cmdGet_Click()
'This calls upon everything in cmdSave
'Then puts the text in txtSave
txtSave.Text = GetSetting(App.ProductName, "Settings", "txtSave", txtSave.Text)
End Sub
Private Sub cmdSave_Click()
'This saves the following:
'1. Product Name [Located under Project > ..Properties > Make]
'2. It writes a category called "Settings"
'3. It writes a sub category called "txtSave"
'4. Under sub category "txtSave" it writes whatever text is in txtSave
SaveSetting App.ProductName, "Settings", "txtSave", txtSave.Text
End Sub
Private Sub txtSave_Change()
'No code goes here
'Just make a txtSave
End Sub

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 99 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.