Nuaj.Cirrus.Utility.FloatTrackbarControl.textBox_Validating C# (CSharp) Method

textBox_Validating() private method

private textBox_Validating ( object sender, CancelEventArgs e ) : void
sender object
e CancelEventArgs
return void
        private void textBox_Validating( object sender, CancelEventArgs e )
        {
            float	fNewValue = 0.0f;
            if ( !float.TryParse( textBox.Text, out fNewValue ) )
            {	// Reset current value...
                textBox.Text = Value.ToString();
                e.Cancel = true;
                return;
            }

            // Notify of the start of value change
            if ( SliderDragStart != null )
                SliderDragStart( this );

            // Commit change
            float	fStartValue = Value;
            Value = fNewValue;

            // Notify of the stop of value change
            if ( SliderDragStop != null )
                SliderDragStop( this, fStartValue );
        }