private void cmb_professor_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyData == Keys.Up || e.KeyData == Keys.Down || e.KeyData == Keys.Left || e.KeyData == Keys.Right || cmb_professor.Text.Length == 0) { return; } if (e.KeyValue == 8) { return; } string[] nomes = GerenciadorBanco.getListaProf(cmb_professor.Text).ToArray(); cmb_professor.DroppedDown = nomes.Length > 0 ? true : false; cmb_professor.Items.Clear(); cmb_professor.Items.AddRange(nomes); cmb_professor.SelectionStart = cmb_professor.Text.Length; }