1 と 2 の 2 つのフォームがあります。Form1 には 1 つのテキスト ボックスがあり、form2 にはテキスト ボックスとボタンがあります。つまり、form2 のテキスト ボックスの値を入力すると、マウス カーソルが form1 のテキスト ボックスに移動します。
private void button1_Click(object sender, EventArgs e)
{
int line = Form1.ab;
for (int i = 1; i < line; i++)
{
if (i == Convert.ToInt16( textBox1.Text))
{
// fr.textbox1 is a textbox form1 and
// textbox1.text is a textbox of the form1
fr.textBox1.SelectionStart =
int.Parse( textBox1.Text) ;
fr.textBox1.ScrollToCaret();
break;
}
}
}