private void searchBox_TextChanged(object sender, EventArgs e)
 {
     if (globalPatientList != null)
     {
         globalPatientList.ActivateSearch();
     }
 }
Example #2
0
        private void CheckEnterKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            for (int i = Application.OpenForms.Count - 1; i >= 0; i--)
            {
                if (Application.OpenForms[i] != this && Application.OpenForms[i].Name != "WelcomeHomePage" &&
                    Application.OpenForms[i].Name != "PatientListView")
                {
                    Application.OpenForms[i].Close();
                }
            }

            if (e.KeyChar == (char)Keys.Return && Application.OpenForms["PatientListView"] as PatientListView == null)

            {
                PatientListView patientListView = new PatientListView(this);
                SetPatientListView(patientListView);
                globalPatientList.ActivateSearch();
            }

            if (e.KeyChar == (char)Keys.Return)
            {
                globalPatientList.ActivateSearch();
            }
        }