用try catch来实现
try { int i = Convert.ToInt32((textBox1.Text)); BtnOK.Enabled = true; } catch (System.Exception ex) { BtnOK.Enabled = false; }
用try catch来实现
try { int i = Convert.ToInt32((textBox1.Text)); BtnOK.Enabled = true; } catch (System.Exception ex) { BtnOK.Enabled = false; }
转载于:https://www.cnblogs.com/xe2011/p/3446470.html