9 Star 8 Fork 1

dodola/MEditor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
GoTo.cs 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
dodola 提交于 2013-06-07 10:38 . init commit
using System;
using System.ComponentModel;
using System.Windows.Forms;
using ICSharpCode.AvalonEdit;
namespace MEditor
{
[DesignerCategory("form")]
public partial class GoToLineDialog : Form
{
//Instance of the control passed via 2nd Constructor
private readonly TextEditor RichTextBoxControl;
//Secondary Constructor (Used)
public GoToLineDialog(TextEditor RTB)
{
RichTextBoxControl = RTB;
InitializeComponent();
}
public int LineNumber
{
get
{
int line = 0;
Int32.TryParse(lnbox.Text, out line);
return line;
}
}
private void Go(object sender, EventArgs e)
{
if (LineNumber > 0 && LineNumber <= RichTextBoxControl.Document.LineCount)
{
RichTextBoxControl.ScrollToLine(LineNumber);
DialogResult = DialogResult.OK;
}
else
MessageBox.Show("MEditor不能转到指定行。", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Close();
}
private void button1_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/dinophp/meditor.git
git@gitee.com:dinophp/meditor.git
dinophp
meditor
MEditor
master

搜索帮助