I have a application which has 6 count down timers. I want the application to store the current end time so in case the computer will shut down, the date will be saved and nothing is lost.
My problem is that the application is saving the date, but when starting the application again it reloads the default settings and not the saved settings.
Here is what I have
public MainWindow()
{
InitializeComponent();
SetupTimer(timer0, watch0_0Time, watch0_0Border);
SetupTimer(timer1, watch0_1Time, watch0_1Border);
SetupTimer(timer2, watch0_2Time, watch0_2Border);
SetupTimer(timer3, watch1_0Time, watch1_0Border);
SetupTimer(timer4, watch1_1Time, watch1_1Border);
SetupTimer(timer5, watch1_2Time, watch1_2Border);
timer0.countTo = Properties.Settings.Default.Timer0Date;
timer1.countTo = Properties.Settings.Default.Timer1Date;
timer2.countTo = Properties.Settings.Default.Timer2Date;
timer3.countTo = Properties.Settings.Default.Timer3Date;
timer4.countTo = Properties.Settings.Default.Timer4Date;
timer5.countTo = Properties.Settings.Default.Timer5Date;
}
….
I am saving later with this call
Properties.Settings.Default.Timer0Date = timer.countTo;
I hope you can help 😀
In c#, you have to call Properties.Settings.Default.Save(). Otherwise than in VB, in c#, the settings will not be saved automatically after a value change.