回答編集履歴
1
回答したコードで動作しなかったため更新
answer
CHANGED
@@ -17,11 +17,11 @@
|
|
17
17
|
public UserControl1 u1;
|
18
18
|
public Form1 f1;
|
19
19
|
|
20
|
-
public Form2(UserControl1 u, Form1
|
20
|
+
public Form2(UserControl1 u, Form1 myParent)
|
21
21
|
{
|
22
22
|
InitializeComponent();
|
23
23
|
u1 = u;
|
24
|
-
f1 =
|
24
|
+
f1 = myParent;
|
25
25
|
}
|
26
26
|
|
27
27
|
private void Button1_Click(object sender, EventArgs e)
|
@@ -47,8 +47,8 @@
|
|
47
47
|
|
48
48
|
if (Isopen == false)
|
49
49
|
{
|
50
|
-
Form1
|
50
|
+
Form1 myParent = (Form1)this.ParentForm;
|
51
|
-
Form2 form2 = new Form2(this,
|
51
|
+
Form2 form2 = new Form2(this, myParent);
|
52
52
|
form2.Show();
|
53
53
|
}
|
54
54
|
}
|