You could always run the
event so as to validate as the data gets entered. It saves the user an additional UI interaction.
private void textBox1_KeyDown(object sender, KeyEventArgs e)
string s = string.Empty;
s += (char)e.KeyValue;
if (!(int.TryParse(s, out i)))
e.SuppressKeyPress = true;
textBox2.Text = "An int, that key press would not create";
textBox2.Text = "On the path to a great int, you are";
I'm an Aircraft Maintenance Engineer gone wild.
After leaving the Air Force I studied Business Info Systems at university and am now working as an automation expert.
Primarily on automation control systems, Factory SCADA, Human Machine interface.
Basically have free reign to improve /build new our manufacturing systems so the work is fun, a nice blend of software and hardware.
Admin for a handful of servers across the country, web master, db admin, maintenance, problem solver, magician, ninja.....
Think Jack of all trades master of none