/// <summary> /// 转到 对话框 /// </summary> public void ShowGoToDlg() { Point pt = this.GetCaretPosition(); GoToDialog frm = new GoToDialog(); frm.label1.Text = "等号(1 - " + this.Lines.Length.ToString() + ")(&L)"; frm.textBox1.Text = pt.X.ToString(); if (frm.ShowDialog() == DialogResult.OK) { int Line = Convert.ToInt32(frm.textBox1.Text); if (Line >= 1) { if (Line > this.Lines.Length + 1) { MessageBox.Show("行数大于现有的行数"); } else { GoToLine(Line); } } } }
/// <summary> /// 转到 对话框 /// </summary> public void ShowGoToDlg() { Point pt = this.GetCaretPosition(); GoToDialog frm = new GoToDialog(); frm.label1.Text = "等号(1 - " + this.Lines.Length.ToString() + ")(&L)"; frm.textBox1.Text = pt.X.ToString(); if (frm.ShowDialog() == DialogResult.OK) { int Line = Convert.ToInt32(frm.textBox1.Text); if (Line >= 1) { if (Line > this.Lines.Length+1) { MessageBox.Show("行数大于现有的行数"); } else { GoToLine(Line); } } } }