コード例 #1
0
        private void Find_TB_TextChanged(object sender, EventArgs e)
        {
            if (pasted)
            {
                Find_TB.SelectAll();
                Find_TB.SelectionColor = Color.Black;

                pasted = false;
            }
        }
コード例 #2
0
        //
        //Find and replace stuff
        //
        #region Find and Replace stuff
        private void ShowSearchMenu(string op)
        {
            Editor_TextBox.Size = new Size(Editor_TextBox.Size.Width, Editor_TextBox.Size.Height - 40);
            tB_line.Size        = new Size(tB_line.Size.Width, tB_line.Size.Height - 40);

            if (op == "find")
            {
                Find_TB.Location              = new Point(Editor_TextBox.Width - 241, 5);
                Find_Button.Location          = new Point(Editor_TextBox.Width - 321, 4);
                SearchOptions_Button.Location = new Point(Editor_TextBox.Width, 4);
                Find_TB.Visible              = !Find_TB.Visible;
                Find_Button.Visible          = !Find_Button.Visible;
                SearchOptions_Button.Visible = !SearchOptions_Button.Visible;

                if (Option1_CB.Text == "Replace all")
                {
                    if (Option1_CB.Checked)
                    {
                        Option1_CB.Checked = false;
                    }
                }
                Option1_CB.Text     = "Subtask";
                Option1_CB.Location = new Point(15, Option1_CB.Location.Y);
                Find_Panel.Visible  = !Find_Panel.Visible;
            }
            if (op == "replace")
            {
                Find_TB.Visible              = !Find_TB.Visible;
                Find_Button.Visible          = !Find_Button.Visible;
                SearchOptions_Button.Visible = !SearchOptions_Button.Visible;
                Replace_TB.Visible           = !Replace_TB.Visible;
                Replace_Button.Visible       = !ShowReplaceMenu_Button.Visible;

                Replace_TB.Location           = new Point(Editor_TextBox.Width - 241, 5);
                Replace_Button.Location       = new Point(Editor_TextBox.Width - 321, 4);
                Find_TB.Location              = new Point(Editor_TextBox.Width - 591, 5);
                Find_Button.Location          = new Point(Editor_TextBox.Width - 671, 4);
                SearchOptions_Button.Location = new Point(Editor_TextBox.Width, 4);

                if (Option1_CB.Text == "Subtask")
                {
                    if (Option1_CB.Checked)
                    {
                        Option1_CB.Checked = false;
                    }
                }
                Option1_CB.Text     = "Replace all";
                Option1_CB.Location = new Point(10, Option1_CB.Location.Y);
                Find_Panel.Visible  = !Find_Panel.Visible;
            }
            if (Find_TB.Visible)
            {
                Find_TB.Focus();
            }
            else
            {
                Editor_TextBox.Focus();
            }

            if (!Find_Panel.Visible)
            {
                Find_TB.Text                = "";
                Replace_TB.Text             = "";
                SearchOptions_Panel.Visible = false;
                Editor_TextBox.Size         = new Size(Editor_TextBox.Size.Width, Editor_TextBox.Size.Height + 80);
                tB_line.Size                = new Size(tB_line.Size.Width, tB_line.Size.Height + 80);
            }
        }