SIL.FieldWorks.TE.KeyTermsControl.FindComboKeyPress C# (CSharp) Method

FindComboKeyPress() private method

private FindComboKeyPress ( object sender, KeyPressEventArgs e ) : void
sender object
e System.Windows.Forms.KeyPressEventArgs
return void
		private void FindComboKeyPress(object sender, KeyPressEventArgs e)
		{
			if (m_findDropDown.Items.Count == 2)
				m_findDropDown.Items.RemoveAt(1);

			if (e.KeyChar != '\r' || string.IsNullOrEmpty(m_cboFind.Text))
				return;

			e.Handled = true;

			if (m_cboFind.SelectedIndex < 0)
				m_cboFind.Items.Add(m_cboFind.Text);
			KeyTermsTree tree = (KeyTermsTree)MainPanelContent;
			KeyTermsTree.FindResult result = tree.FindNextMatch(m_cboFind.Text);
			if (result == KeyTermsTree.FindResult.MatchFound)
				m_findDropDown.Hide();
			else
			{
				ToolStripLabel msg = new ToolStripLabel(result == KeyTermsTree.FindResult.NoMatchFound ?
					Properties.Resources.kstidNoMatchFound : Properties.Resources.kstidNoMoreMatches);
				msg.ForeColor = Color.Red;
				m_findDropDown.Items.Add(msg);
			}
		}
		#endregion