質問編集履歴
2
Form2の追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -28,12 +28,20 @@
|
|
28
28
|
```Form2
|
29
29
|
public partial class Form2 : Form
|
30
30
|
{
|
31
|
+
public UserControl1 u1;
|
31
32
|
public Form1 f1;
|
32
33
|
|
34
|
+
public Form2(UserControl1 u)
|
35
|
+
{
|
36
|
+
InitializeComponent();
|
37
|
+
u1 = u;
|
38
|
+
}
|
39
|
+
|
33
40
|
public Form2(Form1 f)
|
34
41
|
{
|
35
42
|
InitializeComponent();
|
36
43
|
f1 = f;
|
44
|
+
|
37
45
|
}
|
38
46
|
|
39
47
|
private void Button1_Click(object sender, EventArgs e)
|
1
リクエストされたことの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -43,6 +43,28 @@
|
|
43
43
|
}
|
44
44
|
```
|
45
45
|
|
46
|
+
```UserControl1
|
47
|
+
private void ToolStripButton7_Click(object sender, EventArgs e)
|
48
|
+
{
|
49
|
+
bool Isopen = false;
|
50
|
+
foreach (Form u in Application.OpenForms)
|
51
|
+
{
|
52
|
+
if (u.Name == "Form2")
|
53
|
+
{
|
54
|
+
Isopen = true;
|
55
|
+
u.BringToFront();
|
56
|
+
break;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
if (Isopen == false)
|
61
|
+
{
|
62
|
+
Form2 form2 = new Form2(this);
|
63
|
+
form2.Show();
|
64
|
+
}
|
65
|
+
}
|
66
|
+
```
|
67
|
+
|
46
68
|
### 試したこと
|
47
69
|
textBox1のModifiersはPublicになってます。
|
48
70
|
|