9 Star 9 Fork 1

dodola / MEditor

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
GoTo.cs 1.30 KB
Copy Edit Raw Blame History
dodola authored 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();
}
}
}
C
1
https://gitee.com/dinophp/meditor.git
git@gitee.com:dinophp/meditor.git
dinophp
meditor
MEditor
master

Search