473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Saving information when program is exited

Does anyone know how i could save a user textbox entery value and then
when the program is shut down it would save that value for the next
time so that it appears when the user start the program back up

Example:

user enters his name:Chuck

I want to be able to save the entery (chuck) so that when he exits the
program (shut down) and then start it back up again the user entry
name in the textbox would be chuck.

Sep 6 '07 #1
7 1632
cj
Put the code to save the info in the Form1_FormClosi ng event.

cmdolcet69 wrote:
Does anyone know how i could save a user textbox entery value and then
when the program is shut down it would save that value for the next
time so that it appears when the user start the program back up

Example:

user enters his name:Chuck

I want to be able to save the entery (chuck) so that when he exits the
program (shut down) and then start it back up again the user entry
name in the textbox would be chuck.
Sep 6 '07 #2
On Sep 6, 2:57 pm, cmdolcet69 <colin_dolce... @hotmail.comwro te:
Does anyone know how i could save a user textbox entery value and then
when the program is shut down it would save that value for the next
time so that it appears when the user start the program back up

Example:

user enters his name:Chuck

I want to be able to save the entery (chuck) so that when he exits the
program (shut down) and then start it back up again the user entry
name in the textbox would be chuck.
Simplest way to do that is with My.Settings.

Sep 6 '07 #3
On Sep 6, 3:46 pm, za...@construct ion-imaging.com wrote:
On Sep 6, 2:57 pm, cmdolcet69 <colin_dolce... @hotmail.comwro te:
Does anyone know how i could save a user textbox entery value and then
when the program is shut down it would save that value for the next
time so that it appears when the user start the program back up
Example:
user enters his name:Chuck
I want to be able to save the entery (chuck) so that when he exits the
program (shut down) and then start it back up again the user entry
name in the textbox would be chuck.

Simplest way to do that is with My.Settings.
Does vb.net 2003 have a my.settings ???

Sep 6 '07 #4
On Sep 6, 4:07 pm, cmdolcet69 <colin_dolce... @hotmail.comwro te:
On Sep 6, 3:46 pm, za...@construct ion-imaging.com wrote:
On Sep 6, 2:57 pm, cmdolcet69 <colin_dolce... @hotmail.comwro te:
Does anyone know how i could save a user textbox entery value and then
when the program is shut down it would save that value for the next
time so that it appears when the user start the program back up
Example:
user enters his name:Chuck
I want to be able to save the entery (chuck) so that when he exits the
program (shut down) and then start it back up again the user entry
name in the textbox would be chuck.
Simplest way to do that is with My.Settings.

Does vb.net 2003 have a my.settings ???
Looks like it is. But with VS2003, this link may prove useful:

http://msdn2.microsoft.com/en-us/lib...11(VS.80).aspx

Sep 6 '07 #5
On 6 Sep, 21:55, za...@construct ion-imaging.com wrote:
On Sep 6, 4:07 pm, cmdolcet69 <colin_dolce... @hotmail.comwro te:
On Sep 6, 3:46 pm, za...@construct ion-imaging.com wrote:
On Sep 6, 2:57 pm, cmdolcet69 <colin_dolce... @hotmail.comwro te:
Does anyone know how i could save a user textbox entery value and then
when the program is shut down it would save that value for the next
time so that it appears when the user start the program back up
Example:
user enters his name:Chuck
I want to be able to save the entery (chuck) so that when he exits the
program (shut down) and then start it back up again the user entry
name in the textbox would be chuck.
Simplest way to do that is with My.Settings.
Does vb.net 2003 have a my.settings ???

Looks like it is. But with VS2003, this link may prove useful:

http://msdn2.microsoft.com/en-us/lib...11(VS.80).aspx
Go to project properties, and then Settings and add a entry called
"name" make it a type of string and make the default value blank.

Then in your app set the default value under the form_load procedure
like this:

txtName.Text = My.Settings.Nam e

When the program closes, under your form_closed procedure, save it
like this:

My.Settings.Nam e = txtName.Text
My.Settings.Sav e()

--

That's all you need.

Good luck :-)

Phill

Sep 7 '07 #6
On Sep 7, 6:17 am, Phillip Taylor <Phillip.Ross.T ay...@gmail.com >
wrote:
On 6 Sep, 21:55, za...@construct ion-imaging.com wrote:


On Sep 6, 4:07 pm, cmdolcet69 <colin_dolce... @hotmail.comwro te:
On Sep 6, 3:46 pm, za...@construct ion-imaging.com wrote:
On Sep 6, 2:57 pm, cmdolcet69 <colin_dolce... @hotmail.comwro te:
Does anyone know how i could save a user textbox entery value and then
when the program is shut down it would save that value for the next
time so that it appears when the user start the program back up
Example:
user enters his name:Chuck
I want to be able to save the entery (chuck) so that when he exits the
program (shut down) and then start it back up again the user entry
name in the textbox would be chuck.
Simplest way to do that is with My.Settings.
Does vb.net 2003 have a my.settings ???
Looks like it is. But with VS2003, this link may prove useful:
http://msdn2.microsoft.com/en-us/lib...11(VS.80).aspx

Go to project properties, and then Settings and add a entry called
"name" make it a type of string and make the default value blank.

Then in your app set the default value under the form_load procedure
like this:

txtName.Text = My.Settings.Nam e

When the program closes, under your form_closed procedure, save it
like this:

My.Settings.Nam e = txtName.Text
My.Settings.Sav e()

--

That's all you need.

Good luck :-)

Phill- Hide quoted text -

- Show quoted text -
Phil can you be a little more specific, in the programing environment
vb 2003 i can;t seem to find that option. Please let me know....Thanks

Sep 7 '07 #7
cmdolcet69 wrote:
Phil can you be a little more specific, in the programing environment
vb 2003 i can;t seem to find that option. Please let me know....Thanks
The My.Settings thing isn't in vb 2003. You'll have to write your own
procedure to write the data to a file or into the registry, and similarly to
read the data back in when the app. starts.

Andrew
Sep 7 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5440
by: Jacob H | last post by:
Hello list... I'm developing an adventure game in Python (which of course is lots of fun). One of the features is the ability to save games and restore the saves later. I'm using the pickle module to implement this. Capturing current program state and neatly replacing it later is proving to be trickier than I first imagined, so I'm here to...
3
39358
by: James | last post by:
Im having trouble building/running a program which was written under Visual Studio 2000 & .NET Framework 1.0. Im now using a new installation of .NET 1.1 with Visual Studio 2003, otherwise there have been no changes to the code. Although there appears to be no build errors, the program terminates almost as soon as it has begun with the debug...
2
2284
by: eth0 | last post by:
I hate to ask like this as I normally like to work things out for myself, but I am running out of ideas....and hair !!! I am writing a stock inventory program using structures. The program data is initially populated by hand, and then there is an option to save the array of structures to disk. If the program is exited, the data will need...
3
3592
by: cdj | last post by:
Hi all, I've got a picturebox on a form, and a save button. When I go to save, the app craps out with the following error: ================== An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in system.drawing.dll
0
1194
by: c# newbie | last post by:
When starting a c# asp.net web site in visual studio 2003, the following message appears in the debugger window: The thread 0x7bc has exited with code 0 (0x0). The program ' IEXPLORE.EXE: Script program' has exited with code 0 (0x0).
15
1499
by: Dan DeConinck | last post by:
Hello, I want to save the position of all the controls on my form. I would like to write them out to a preference file. I have done this in DOS BASIC like this: TO WRITE the preference open "c:\preferences.txt" for input as #1 input #1 ,a,b,c
4
1121
by: Martin the Third | last post by:
Okay, I have a program that has many optional windows. Its not mdi or anything, it just has alot of windows that you can choose to have that would add extra features to the program. Now, I need to have the properties of these windows to stay when the user exits (which windows are opened/closed, etc). Ive already set it up so that it reads...
1
2707
by: garyusenet | last post by:
Hi All, I'm eagerly anticipating what you have to say on something that's stumped me over the weekend. I'm writing a small application which utilises a treeview control. I've figured out how to programatically add nodes to it, but everytime the program is exited the treeview control resets itself. I looked for a save method or something...
4
2387
by: corey11 | last post by:
I'm a very low-level developer with limited VB knowledge but nonetheless was able to put together a very user-friendly and extremely helpful Access 97 database for my company some 10 years back. We use the database for inventory, job costing, employee records, timecard recording, nearly everything except the hard core accounting. The database is...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.