DoSearchFromCode() публичный Метод

This is called by the frmCodeView class to initiate a search from outside
public DoSearchFromCode ( string strText ) : void
strText string
Результат void
Пример #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;
         }
     }
 }
Пример #2
0
 private void searchToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (richText.SelectedText.Length > 0)
     {
         frmMaster.DoSearchFromCode(richText.SelectedText.TrimEnd(' '));
     }
 }