System.Windows.Forms.TextBoxInt32.checkValue C# (CSharp) Method

checkValue() public method

checks if the value is within its borders
public checkValue ( ) : System.Boolean
return System.Boolean
        public Boolean checkValue()
        {
            Boolean isOk = true;
            Int32 IntValue = 0;

            if(Int32.TryParse(this.Text, out IntValue))
            {
                if(MinValue.HasValue && (IntValue < MinValue))
                    isOk = false;

                if(MaxValue.HasValue && (IntValue > MaxValue))
                    isOk = false;
            }
            else
                isOk = false;
            
            return isOk;
        }
    }
TextBoxInt32