Пример #1
0
        private void menuitemEditGoTo_Click(object sender, EventArgs e)
        {
            var GoToLinePrompt = new GoToLinePrompt(LineIndex + 1);

            GoToLinePrompt.Left = Left + 5;
            GoToLinePrompt.Top  = Top + 44;

            if (GoToLinePrompt.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            var TargetLineIndex = GoToLinePrompt.LineNumber - 1;

            if (TargetLineIndex > controlContentTextBox.Lines.Length)
            {
                MessageBox.Show(this, "The line number is beyond the total number of lines", "NotepadClone.Net - Goto Line");
                return;
            }

            LineIndex = TargetLineIndex;
        }
Пример #2
0
        //Edit.Go TO
        private void goToToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var GoToLinePrompt = new GoToLinePrompt(LineIndex + 1);

            GoToLinePrompt.Left = Left;
            GoToLinePrompt.Top  = Top;

            if (GoToLinePrompt.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            var TargetLineIndex = GoToLinePrompt.LineNumber - 1;

            if (TargetLineIndex > richTextBox1.Lines.Length)
            {
                MessageBox.Show(this, "The line number is beyond the total number of lines", "NotepadClone.Net - Goto Line");
                return;
            }

            LineIndex = TargetLineIndex;
        }
Пример #3
0
        private void menuitemEditGoTo_Click(object sender, EventArgs e)
        {
            var GoToLinePrompt = new GoToLinePrompt(LineIndex + 1);
            GoToLinePrompt.Left = Left + 5;
            GoToLinePrompt.Top = Top + 44;

            if (GoToLinePrompt.ShowDialog(this) != DialogResult.OK) return;

            var TargetLineIndex = GoToLinePrompt.LineNumber - 1;

            if (TargetLineIndex > controlContentTextBox.Lines.Length) {
                MessageBox.Show(this, "The line number is beyond the total number of lines", "NotepadClone.Net - Goto Line");
                return;
            }

            LineIndex = TargetLineIndex;
        }