/// <summary> ///股票代码检查 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void stockntb_TextChanged(object sender, EventArgs e) { GeneralClass gc = new GeneralClass(); if (!gc.IsInt(stockntb.Text)) { MessageBox.Show("Please input stock code!", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); stockntb.SelectAll(); stockntb.Focus(); return; } }
/// <summary> /// 股票输入框检验,限定为数字 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void stockntb_TextChanged(object sender, EventArgs e) { GeneralClass gc = new GeneralClass(); if (!gc.IsInt(stockntb.Text)) { MessageBox.Show("应该是一个数字", "数据输入错误提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); stockntb.SelectAll(); stockntb.Focus(); return; } }