private string BarCode = ""; private void evtKeyUpEvent(object sender, KeyEventArgs e) { if (Keys.NumPad0 <= e.KeyCode && e.KeyCode <= Keys.NumPad9) { BuildBarCode((e.KeyCode - Keys.NumPad0).ToString()); } else if (Keys.D0 <= e.KeyCode && e.KeyCode <= Keys.D9) { BuildBarCode((e.KeyCode - Keys.D0).ToString()); } if (65 <= e.KeyValue && e.KeyValue <= 90) { BuildBarCode((e.KeyCode).ToString()); } else if (Keys.ShiftKey == e.KeyCode) { } else if (Keys.OemPeriod == e.KeyCode) { BuildBarCode("."); } else if (Keys.Multiply == e.KeyCode) { BuildBarCode("*"); } else if (Keys.Add == e.KeyCode) { BuildBarCode("+"); } else if (Keys.Separator == e.KeyCode) { BuildBarCode("|"); } else if (Keys.Subtract == e.KeyCode) { BuildBarCode("-"); } else if (Keys.Divide == e.KeyCode) { BuildBarCode("/"); } else if (Keys.OemBackslash == e.KeyCode) { BuildBarCode(@"\"); } else if (Keys.Separator == e.KeyCode) { BuildBarCode(","); } else if (Keys.OemMinus == e.KeyCode) { BuildBarCode("-"); } else if (Keys.Space == e.KeyCode) { BuildBarCode(" "); } else if (Keys.OemCloseBrackets == e.KeyCode) { BuildBarCode(")"); } else if (Keys.OemOpenBrackets == e.KeyCode) { BuildBarCode("("); } else if (Keys.Oemtilde == e.KeyCode) { BuildBarCode("~"); } else if (Keys.Oemcomma == e.KeyCode) { BuildBarCode(","); } else if (Keys.OemSemicolon == e.KeyCode) { BuildBarCode(";"); } else if (Keys.OemSemicolon == e.KeyCode) { BuildBarCode(";"); } else if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) { updateUIBarCode(BarCode); } } private void BuildBarCode(string value) { BarCode = string.Concat(BarCode, value); } public void updateUIBarCode(string i) { AddNewRowWithCode(i); }
updateUIBarCode
else if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)