private void DisplayID_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { AddCombo_Click(sender, e); DisplayID.Clear(); } }
private void AddCombo_Click(object sender, EventArgs e) { if (Regex.Match(DisplayID.Text.Trim(), "^[0-9]+$").Success) { LstSearch.Items.Add("Display ID : " + DisplayID.Text.Trim()); LstSearch.SelectedIndex = LstSearch.FindStringExact("Display ID : " + DisplayID.Text.Trim()); addColorText(ResultBox, Color.Blue, "DisplayID Added to Decrypt List : " + LstSearch.SelectedItem.ToString().Split(':')[1].Trim()); } else { Utils.Show("Enter a DisplayID please", "Error", 2000); DisplayID.Clear(); } }