Click here to Skip to main content
15,886,077 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more: , +
Hello Guys, How are you, I hope you will be fine guys, I am facing a small issue and that is I want to know how to save user settings without close application'
because I want to get the new value without closing the application.

Thanks

What I have tried:

private void save_Click(object sender, EventArgs e)
{
Properties.Settings.Default.Source = textBox1.Text;
Properties.Settings.Default.Save();
Application.Exit();
}
Posted
Updated 20-Jun-17 9:28am
Comments
Richard MacCutchan 20-Jun-17 3:33am    
Just remove the Application.Exit(); statement.
[no name] 20-Jun-17 15:43pm    
Only a virtual 5 here.

1 solution

Try
C#
private void save_Click(object sender, EventArgs e)
{
   Properties.Settings.Default.Source = textBox1.Text;
   Properties.Settings.Default.Save();
   Application.Exit();
}
 
Share this answer
 
Comments
Member 9983063 20-Jun-17 16:15pm    
i have tried it but it's working but when i close application and reopen my application so i get previous value not new as i saved before
Patrice T 20-Jun-17 16:41pm    
We can't help you without code.
Member 9983063 20-Jun-17 21:19pm    
i have wrote my code here before what i have used

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900