SampleApp.MainForm.focalLengthBox_Leave C# (CSharp) Method

focalLengthBox_Leave() private method

private focalLengthBox_Leave ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        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.");
            }
        }
MainForm