D
David Veeneman
I am using application settings in C# 2.0 to save a form's size. I used this
code to retrieve the setting in the FormLoad event:
// Set window size
if (Properties.Settings.Default.FormSize != null)
{
this.Size = Properties.Settings.Default.FormSize;
}
The code generated a runtime error, saying that the property was null, and
that I should check to see if the property is null before calling it. Which,
of course, is exactly what I'm doing!
How do I test the setting to see if it has a value? Thanks in advance.
code to retrieve the setting in the FormLoad event:
// Set window size
if (Properties.Settings.Default.FormSize != null)
{
this.Size = Properties.Settings.Default.FormSize;
}
The code generated a runtime error, saying that the property was null, and
that I should check to see if the property is null before calling it. Which,
of course, is exactly what I'm doing!
How do I test the setting to see if it has a value? Thanks in advance.