コード例 #1
0
        private void booleanVerifyevent(object sender, CancelEventArgs e)
        {
            TextBox textbox = (TextBox)sender;

            if (!ValidityHelperClass.isBoolean(textbox.Text))
            {
                Color textColor = Color.Red;
                textbox.ForeColor = textColor;
            }
            else
            {
                Color textColor = Color.Black;
            }
        }
コード例 #2
0
        public bool okButton_validating()
        {
            string text = ValueTextbox.Text;

            switch (typeComboBox.SelectedItem as string)
            {
            case "Float":
                return(ValidityHelperClass.isFloat(text));

            case "Uint":
                return(ValidityHelperClass.isUint(text));

            case "Int":
                return(ValidityHelperClass.isInt(text));

            case "Boolean":
                return(ValidityHelperClass.isBoolean(text));
            }
            return(true);
        }