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

質問編集履歴

3

修正

2019/06/26 03:33

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -34,11 +34,11 @@
34
34
  }
35
35
  Form1 f1 = new Form1();
36
36
  f1.Show();
37
- this.Close();
37
+ this.Close();            //3回処理したらForm1に戻る
38
38
 
39
39
  // 1,2回目までは戻どって、3回処理したら次の処理に行きたい
40
+    
40
41
 
41
-
42
42
  }
43
43
  ```
44
44
  今繰り返す処理を書きたいと思ったのですが、やり方わからず質問しました。

2

修正

2019/06/26 03:33

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
  else
29
29
  {
30
- textBox2.Text = "間違っている";
30
+ textBox2.Text = "該当なし";
31
31
  }
32
32
 
33
33
  i++;

1

修正

2019/06/26 03:31

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -6,22 +6,35 @@
6
6
  {
7
7
 
8
8
  //ここまで戻す処理を書きたい。
9
- if (textBox1.Text == "11111")   //キー入力の数字(文字列)
9
+ for (int i = 0; i > 3; )
10
10
  {
11
+ if (textBox1.Text == "11111")
12
+ {
11
- textBox2.Text = "Hello, ";  //テキスト2に表示
13
+ textBox2.Text = "w1";
12
- }
14
+ }
13
- else if(textBox1.Text=="111112")
15
+ else if (textBox1.Text == "111112")
14
- {
16
+ {
15
17
  textBox2.Text = "w2";
16
- }
18
+ }
17
- else if(textBox1.Text=="111113")
19
+ else if (textBox1.Text == "111113")
18
- {
20
+ {
19
21
  textBox2.Text = "w3";
20
- }
22
+ }
21
- else if(textBox1.Text=="111114")
23
+ else if (textBox1.Text == "111114")
22
- {
24
+ {
23
25
  textBox2.Text = "w4";
26
+ }
27
+
28
+ else
29
+ {
30
+ textBox2.Text = "間違っている";
31
+ }
32
+
33
+ i++;
24
34
  }
35
+ Form1 f1 = new Form1();
36
+ f1.Show();
37
+ this.Close();
25
38
 
26
39
  // 1,2回目までは戻どって、3回処理したら次の処理に行きたい
27
40