TextBox
Text
int x; if (int32.TryParse(textBox1.Text, out x)) { // you have a valid integer // and you can do what you want with x } else { // the text contains invalid characters // put up an error message }
public int TextBoxValue { get { return int.Parse(TextBox.Text); } set { TextBox.Text = value.ToString(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)