Example #1
0
        /// <summary>
        /// Перейти на указанную строку
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuActionGoTo_Click(object sender, EventArgs e)
        {
            var gotoForm = new GoToForm(this, Convert.ToInt32(LineCount));

            gotoForm.ShowDialog();

            if (GoToLine < 1)
            {
                return;
            }
            GoToLine--;

            int max  = textWindow.Text.Length;
            int step = max / 10;
            int line = 0;
            int ind  = 0;

            while (line != GoToLine)
            {
                ind += step;
                line = textWindow.GetLineFromCharIndex(ind);
                if (line > GoToLine)
                {
                    ind  -= step;
                    step /= 10;
                    if (step == 0)
                    {
                        step++;
                    }
                }
            }

            textWindow.SelectionStart = textWindow.GetFirstCharIndexFromLine(line);
            textWindow.ScrollToCaret();
        }
Example #2
0
        private void перейтиToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GoToForm gotoform = new GoToForm();

            gotoform.Owner = this;
            gotoform.ShowDialog();
        }
Example #3
0
        private void mEditGo_Click(object sender, EventArgs e)
        {
            GoToForm gotoform = new GoToForm();

            gotoform.Owner         = this;
            gotoform.tbNum.Minimum = 0;
            gotoform.tbNum.Maximum = notebox.Lines.Count();
            gotoform.ShowDialog();
        }