private void focalLengthBox_Leave(object sender, EventArgs e)
{
float value;
if (float.TryParse(focalLengthBox.Text, NumberStyles.Float, CultureInfo.InvariantCulture, out value))
{
focalLength = value;
}
else
{
focalLengthBox.Text = focalLength.ToString();
errorProvider.SetError(focalLengthLabel, "Wrong focal length was specified. Restored to previous value.");
}
}