日期:2014-05-17 浏览次数:20954 次
private void frmModify_Load(object sender, EventArgs e) { InsertColumn(); this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.frmModify_KeyUp); this.KeyPreview = true; //窗体接收所有键事件 if (Scanner_Open()) { thread = new Thread(ScannerRd); thread.IsBackground = true; thread.Start(); timer1.Enabled = true; } else { MessageBox.Show("扫描失败"); } }
private void frmModify_KeyUp(object sender, KeyEventArgs e) { j++; //MessageBox.Show(e.KeyValue.ToString()); switch (e.KeyValue) { case 27: //if (dt.Rows.Count > 0) // dt.Rows.RemoveAt(dt.Rows.Count - 1); int i = dt.Rows.Count; if (i > 0) dt.Rows.RemoveAt(i - 1); break; case 37: case 39: Scanner_Trig(); timer1.Enabled = false; break; default: break; } }