Engines/FlatRedBallXNA/FlatRedBall/Gui/TextBox.cs
/// <summary>
/// Makes sure the current text can be successfully parsed, and if not, changes it to 0.
/// </summary>
Makes sure the current text can be successfully parsed, and if not, changes it to 0.
Makes sure the current text can be successfully parsed and if not changes it to 0 .
private void FixNumericalInput()
        {
            if ((this.Format == TextBox.FormatTypes.Integer || this.Format == TextBox.FormatTypes.Decimal))
            {
                if((this.Text == "" || this.Text == "-" || this.Text == "." || this.Text == ","))
                    this.Text = "0";
                if (this.Format == FormatTypes.Integer && this.Text.StartsWith("."))
                    this.Text = "0";
            }
        }
private void FixNumericalInput ( ) { if ( ( this . Format == TextBox . FormatTypes . Integer || this . Format == TextBox . FormatTypes . Decimal ) ) { if ( ( this . Text == " " || this . Text == " " || this . Text == " " || this . Text == " " ) ) this . Text = " " ; if ( this . Format == FormatTypes . Integer && this . Text . StartsWith ( " " ) ) this . Text = " " ; } }
Makes sure the current text can be successfully parsed, and if not, changes it to 0.
Makes sure the current text can be successfully parsed and if not changes it to 0 .
// If the text starts with a period and the text box is an integer, make the displayed value a 0.