示例#1
0
        private void lagFreeCirclesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FastColoredTextBoxNS.FastColoredTextBox myTB = krbTabControl1.SelectedTab.Controls[0] as FastColoredTextBoxNS.FastColoredTextBox;
            myTB.InsertText(Properties.Resources.LagFreeCircles);
            Range r = myTB.Range.Clone();

            r.End = new Place(myTB[myTB.LinesCount - 1].Count, myTB.LinesCount - 1);
            var pattern = Regex.Escape("function OnLoad()");

            foreach (var found in r.GetRanges(pattern))
            {
                myTB.Selection = found;
                myTB.Text.Insert(found.Start.iChar + 1, "test");
            }
        }
示例#2
0
 private void btReplace_Click(object sender, EventArgs e)
 {
     try
     {
         if (tb.SelectionLength != 0)
         {
             tb.InsertText(tbReplace.Text);
         }
         btFindNext_Click(sender, null);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#3
0
 private void btReplace_Click(object sender, EventArgs e)
 {
     try
     {
         if (tb.SelectionLength != 0)
         {
             if (!tb.Selection.ReadOnly)
             {
                 tb.InsertText(tbReplace.Text);
             }
         }
         btFindNext_Click(sender, null);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, MBCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }