teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

修正

2017/12/22 08:07

投稿

lain
lain

スコア161

answer CHANGED
@@ -10,19 +10,17 @@
10
10
  {
11
11
  Form2 fm2 = new Form2();
12
12
  fm2.Owner = this;
13
- fm2.Show();
13
+ fm2.Open();
14
14
  }
15
15
 
16
16
 
17
17
  //Form2クラス
18
18
  public Form1 main;
19
- public Form2()
19
+ public void open()
20
20
  {
21
- this.FormBorderStyle = FormBorderStyle.FixedDialog;
21
+ bt.Text = "Click(&C)";
22
+ bt.Click += new EventHandler(btClick);
22
- this.MaximazeBox = false;
23
+ this.Show();
23
- this.MinimizeBox = false;
24
24
  main = (Form1)this.Owner;
25
25
  }
26
-
27
-
28
26
  ```

1

誤字

2017/12/22 08:07

投稿

lain
lain

スコア161

answer CHANGED
@@ -4,9 +4,6 @@
4
4
  これだと、mainは呼び出し元のForm1とは別物になってます。
5
5
  Form.Ownerプロパティ使ってみてください。
6
6
 
7
- (fm2.Open();が謎ですが?)
8
-
9
-
10
7
  ```ここに言語を入力
11
8
  //Form1クラス
12
9
  public void btClick(Object sender, EventArgs e)