转到.cs
资源名称:Notebook.rar [点击查看]
上传用户:hueiseng
上传日期:2022-07-26
资源大小:156k
文件大小:1k
源码类别:
C#编程
开发平台:
Visual C++
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace 笔记本
- {
- public partial class 转到 : Form
- {
- public 转到()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- Form1 f1 = (Form1)this.Owner;
- int a=Int32.Parse(textBox1.Text );
- if (a == 0) a= 1;
- a = f1.richTextBox1.GetFirstCharIndexFromLine(a -1);
- if (a >= 0)
- {
- f1.richTextBox1.Select(a, 0);
- }
- else
- {
- MessageBox.Show("超出查找范围");
- }
- Close();
- }
- }
- }