Win.CodeNavi.frmMain.DoSearchFromCode C# (CSharp) Method

DoSearchFromCode() public method

This is called by the frmCodeView class to initiate a search from outside
public DoSearchFromCode ( string strText ) : void
strText string
return void
        public void DoSearchFromCode(string strText)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(() => { DoSearchFromCode(strText); }));
            }
            else
            {
                txtSearch.Text = strText;
                DoSearch();
            }
        }

Usage Example

コード例 #1
0
 private void frmCodeViewNew_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode.Equals(Keys.Escape))
     {
         if (MessageBox.Show("Are you sure you wish to close this file?", "Are you sure?", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
         {
             //this.Visible = false;
             this.Close();
         }
     }
     else if (e.Control && e.KeyCode.ToString().Equals("W"))
     {
         if (MessageBox.Show("Are you sure you wish to close this file?", "Are you sure?", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
         {
             //this.Visible = false;
             this.Close();
         }
     }
     else if (e.KeyCode.Equals(Keys.Enter)) // this is a terrible hack as the onKeyPress events didn't fire in the Scintilla events
     {
         if (this.Scintilla.Selection.Length > 0)
         {
             frmMaster.DoSearchFromCode(Scintilla.Selection.Text.TrimEnd(' '));
             e.Handled = true;
         }
     }
 }
All Usage Examples Of Win.CodeNavi.frmMain::DoSearchFromCode