示例#1
0
        private void btn_GoTo_Click(object sender, EventArgs e)
        {
            if (txt_LineNumber.Text == "")
            {
                return;
            }

            int line = Convert.ToInt32(txt_LineNumber.Text);

            if (line > _lineNumber || line == 0)
            {
                MessageBox.Show("Line number is out of range", "Notepad - GoTo", MessageBoxButtons.OK);
                return;
            }

            _GoToLineHandler(line - 1);
            UseEditForm.CloseForm();
        }
示例#2
0
        public static void SwitchForm(Form owner, Keys key)
        {
            switch (key)
            {
            case Keys.F:
                UseEditForm.Edit(owner, typeof(SearchForm), _StartIndex);
                break;

            case Keys.G:
                UseEditForm.Edit(owner, typeof(GoToForm), _Content.Split('\n').Length);
                break;

            case Keys.H:
                UseEditForm.Edit(owner, typeof(ReplaceForm), _StartIndex);
                break;

            case Keys.P:
                UseEditForm.Edit(owner, typeof(EncryptForm), _Content);
                break;
            }
        }
示例#3
0
 private void btn_Cancel_Click(object sender, EventArgs e)
 {
     UseEditForm.CloseForm();
 }