MainForm と AnotherForm があります。AnotherForm は、MainForm の menuItem を介してアクセスされます。
AnotherForm には listView があります。ユーザーがアイテムをクリックすると、文字列要素を取得して MainForm のテキスト ボックスに渡したいので、要素がそこに表示され、AnotherForm が閉じられます。これまでのところ、AnotherForm は閉じますが、MainForm のテキスト ボックスには何も表示されません。助言がありますか?
private void listView1_ItemActivate(object sender, EventArgs e)
{
string input = listView1.SelectedItem[0].ToString();
MainForm mainF = new MainForm(input);// called the constructor
this.Close(); //close this form and pass the input to MainForm
mainF.inputTextBox.Text = input;
mainF.loadThis(input);
}