Nuaj.Cirrus.Utility.IntegerTrackbarControl.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 )
        {
            int	NewValue = 0;
            if ( !int.TryParse( textBox.Text, out NewValue ) )
            {	// 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
            int		StartValue = Value;
            Value = NewValue;

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