By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,590 Members | 663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,590 IT Pros & Developers. It's quick & easy.

How to save textbox contents and restore on next run?

P: 1
hello
how can i store a text1.text at my form so that
when i reload that form the content of that text
hasn't gone?
May 7 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
hello
how can i store a text1.text at my form so that
when i reload that form the content of that text
hasn't gone?
What version of VB are you using?

Generally speaking, if you set the contents of a textbox at design-time, it will be retained when the program is executed, because it is stored in the EXE file.

At runtime, any changes made the contents, by the user or the program code, are temporary, discarded when the form is unloaded. In this case, if you want the text to be available again next time you run the program, you will have to store it somewhere. There are a number of options, including (but probably not limited to)...
  • An entry in the Windows registry
  • Writing it to a text file
  • In VB6 there is an object called a PropertyBag which I believe provides some sort of capabilities for saving and restoring control properties like this.
May 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.