用try catch来实现
try { int i = Convert.ToInt32((textBox1.Text)); BtnOK.Enabled = true; } catch (System.Exception ex) { BtnOK.Enabled = false; }