示例#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
文件: Main.cs 项目: mumu/NotepadClone
        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;
        }