private List<string> _lstTmp = new List<string>(); private void tEdit_subdivision_time_weight_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\r') { string tmp = string.Empty; for (int ii = 0; ii < _lstTmp.Count; ii++) { tmp += _lstTmp[ii].ToString(); } System.Windows.Forms.MessageBox.Show(tmp); _lstTmp.Clear(); } else { _lstTmp.Add(e.KeyChar.ToString()); } }