January 14th, 2013, 06:06 PM
Saving srting problem
I am using visual studio in form mode where i have a textbox, a button and a label. When the user insert a value in the textbox and the button is pressed, the value will be saved in integer X. when the form is closed the value in integer X is saved and it is re-loaded in integer X when the form is loaded again. The value is then displayed in the label to confirm that the value is being saved.
For some reason the label is not changing (i.e. stays as Label1), which indicates that the integer isn't being saved or re-loaded.
Can someone please guide me where is the mistake please??
Below is the saving code:
Below is the re-loading code:
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
string get = X.ToString(); //convert integer "X" to string "get"
Properties.Settings.Default.test = get;
I also included ' using testing.Properties; ' at the beginning of the coding.
private void Form1_Load(object sender, EventArgs e)
get = Properties.Settings.Default.test;
label1.Text = get;
Attached is a settings screenshot.
Any help would be appreciated.
Thanks in advance.
Last edited by Dritech; January 14th, 2013 at 06:11 PM.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.