AsterixDisplayAnalyser.UpdateSPD.comboBox1_KeyPress C# (CSharp) Метод

comboBox1_KeyPress() приватный Метод

private comboBox1_KeyPress ( object sender, KeyPressEventArgs e ) : void
sender object
e System.Windows.Forms.KeyPressEventArgs
Результат void
        private void comboBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            string allowedCharacterSet = "0123456789\b";    	   //Allowed character set

            if (allowedCharacterSet.Contains(e.KeyChar.ToString()))
            {

            }
            else if (e.KeyChar.ToString() == "\r")
            {
                e.Handled = true;

                if (TrackToUpdate != 1)
                {
                    if (this.comboBox1.Text.Length > 0)
                        DynamicDisplayBuilder.UpdateSPD(TrackToUpdate, this.comboBox1.Text);
                    FormMain MainFrame = Application.OpenForms[0] as FormMain;
                    MainFrame.UpdateDIsplay();
                    this.Close();
                }
            }
        }