コード例 #1
0
ファイル: FindDialog.cs プロジェクト: leightonbb/dgrok2015
 public static Regex Execute()
 {
     using (FindDialog dialog = new FindDialog())
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             return(dialog.Regex);
         }
         return(null);
     }
 }
コード例 #2
0
 private void textBox1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Control && e.KeyCode == Keys.F)
     {
         e.Handled = true;
         Regex regex = FindDialog.Execute();
         if (regex != null)
         {
             _findRegex = regex;
             FindNext(0);
         }
     }
     else if (e.KeyCode == Keys.F3)
     {
         FindNext(textBox1.SelectionStart + 1);
     }
 }