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

質問編集履歴

4

コードをインデントで囲いました。

2019/08/03 05:37

投稿

bjjdai
bjjdai

スコア7

title CHANGED
File without changes
body CHANGED
@@ -12,6 +12,7 @@
12
12
  enptyステートメントが間違っている可能性があります。
13
13
 
14
14
  ### 該当のソースコード
15
+ ```
15
16
  using System;
16
17
  using System.Collections.Generic;
17
18
  using System.ComponentModel;
@@ -28,13 +29,11 @@
28
29
  {
29
30
  public Form1()
30
31
  {
31
- ```
32
- InitializeComponent();
32
+ InitializeComponent();
33
33
  DataGridViewCheckBoxColumn column = new DataGridViewCheckBoxColumn();
34
34
  dataGridView1.Columns.Add(column);
35
35
  for (int i = 0; i < dataGridView1.RowCount; i++) ;
36
36
  if (Convert.ToBoolean(new DataGridViewCheckBoxColumn()));
37
- ```
38
37
 
39
38
  }
40
39
  public class MyButton : Button
@@ -43,11 +42,9 @@
43
42
  }
44
43
  private void 登録_Click(object sender, EventArgs e)
45
44
  {
46
- ```
47
- int Row = this.dataGridView1.Rows.Add();
45
+ int Row = this.dataGridView1.Rows.Add();
48
- this.dataGridView1.Rows[Row].Cells[1].Value = dateTimePicker1.Value.ToString();
46
+ this.dataGridView1.Rows[Row].Cells[1].Value = DateTimePicker1.Value.ToString();
49
47
  this.dataGridView1.Rows[Row].Cells[2].Value = textBox1.Text;
50
- ```
51
48
 
52
49
  }
53
50
 
@@ -63,16 +60,12 @@
63
60
 
64
61
  private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
65
62
  {
66
- ```
67
- Convert.ToBoolean(dataGridView1.Rows[1].Cells[0].Value);
63
+ Convert.ToBoolean(dataGridView1.Rows[1].Cells[0].Value);
68
- ```
69
64
  }
70
65
 
71
66
  private void 削除_Click(object sender, EventArgs e)
72
67
  {
73
- ```
74
- this.dataGridView1.CurrentCell.Value = DBNull.Value;
68
+ this.dataGridView1.CurrentCell.Value = DBNull.Value;
75
- ```
76
69
 
77
70
  }
78
71
 
@@ -82,6 +75,7 @@
82
75
  }
83
76
  }
84
77
  }
78
+ ```
85
79
 
86
80
  ### 試したこと
87
81
  どこから試せばいいかわからないので、ためしていません。

3

コードをインデントで囲いました。

2019/08/03 05:37

投稿

bjjdai
bjjdai

スコア7

title CHANGED
File without changes
body CHANGED
@@ -28,13 +28,13 @@
28
28
  {
29
29
  public Form1()
30
30
  {
31
- '''
31
+ ```
32
32
  InitializeComponent();
33
33
  DataGridViewCheckBoxColumn column = new DataGridViewCheckBoxColumn();
34
34
  dataGridView1.Columns.Add(column);
35
35
  for (int i = 0; i < dataGridView1.RowCount; i++) ;
36
36
  if (Convert.ToBoolean(new DataGridViewCheckBoxColumn()));
37
- '''
37
+ ```
38
38
 
39
39
  }
40
40
  public class MyButton : Button
@@ -43,11 +43,11 @@
43
43
  }
44
44
  private void 登録_Click(object sender, EventArgs e)
45
45
  {
46
- '''
46
+ ```
47
47
  int Row = this.dataGridView1.Rows.Add();
48
48
  this.dataGridView1.Rows[Row].Cells[1].Value = dateTimePicker1.Value.ToString();
49
49
  this.dataGridView1.Rows[Row].Cells[2].Value = textBox1.Text;
50
- '''
50
+ ```
51
51
 
52
52
  }
53
53
 
@@ -63,16 +63,16 @@
63
63
 
64
64
  private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
65
65
  {
66
- '''
66
+ ```
67
67
  Convert.ToBoolean(dataGridView1.Rows[1].Cells[0].Value);
68
- '''
68
+ ```
69
69
  }
70
70
 
71
71
  private void 削除_Click(object sender, EventArgs e)
72
72
  {
73
- '''
73
+ ```
74
74
  this.dataGridView1.CurrentCell.Value = DBNull.Value;
75
- '''
75
+ ```
76
76
 
77
77
  }
78
78
 

2

コードをインデントで囲いました。

2019/08/03 05:20

投稿

bjjdai
bjjdai

スコア7

title CHANGED
File without changes
body CHANGED
@@ -28,11 +28,13 @@
28
28
  {
29
29
  public Form1()
30
30
  {
31
+ '''
31
- 'InitializeComponent();
32
+ InitializeComponent();
32
33
  DataGridViewCheckBoxColumn column = new DataGridViewCheckBoxColumn();
33
34
  dataGridView1.Columns.Add(column);
34
35
  for (int i = 0; i < dataGridView1.RowCount; i++) ;
35
- if (Convert.ToBoolean(new DataGridViewCheckBoxColumn()));'
36
+ if (Convert.ToBoolean(new DataGridViewCheckBoxColumn()));
37
+ '''
36
38
 
37
39
  }
38
40
  public class MyButton : Button
@@ -41,9 +43,11 @@
41
43
  }
42
44
  private void 登録_Click(object sender, EventArgs e)
43
45
  {
46
+ '''
44
- 'int Row = this.dataGridView1.Rows.Add();
47
+ int Row = this.dataGridView1.Rows.Add();
45
48
  this.dataGridView1.Rows[Row].Cells[1].Value = dateTimePicker1.Value.ToString();
46
- this.dataGridView1.Rows[Row].Cells[2].Value = textBox1.Text;'
49
+ this.dataGridView1.Rows[Row].Cells[2].Value = textBox1.Text;
50
+ '''
47
51
 
48
52
  }
49
53
 
@@ -59,12 +63,16 @@
59
63
 
60
64
  private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
61
65
  {
66
+ '''
62
- 'Convert.ToBoolean(dataGridView1.Rows[1].Cells[0].Value);'
67
+ Convert.ToBoolean(dataGridView1.Rows[1].Cells[0].Value);
68
+ '''
63
69
  }
64
70
 
65
71
  private void 削除_Click(object sender, EventArgs e)
66
72
  {
73
+ '''
67
- ' this.dataGridView1.CurrentCell.Value = DBNull.Value;'
74
+ this.dataGridView1.CurrentCell.Value = DBNull.Value;
75
+ '''
68
76
 
69
77
  }
70
78
 

1

コードをインデントで囲いました。

2019/08/03 03:04

投稿

bjjdai
bjjdai

スコア7

title CHANGED
File without changes
body CHANGED
@@ -28,11 +28,11 @@
28
28
  {
29
29
  public Form1()
30
30
  {
31
- InitializeComponent();
31
+ 'InitializeComponent();
32
32
  DataGridViewCheckBoxColumn column = new DataGridViewCheckBoxColumn();
33
33
  dataGridView1.Columns.Add(column);
34
34
  for (int i = 0; i < dataGridView1.RowCount; i++) ;
35
- if (Convert.ToBoolean(new DataGridViewCheckBoxColumn()));
35
+ if (Convert.ToBoolean(new DataGridViewCheckBoxColumn()));'
36
36
 
37
37
  }
38
38
  public class MyButton : Button
@@ -41,9 +41,9 @@
41
41
  }
42
42
  private void 登録_Click(object sender, EventArgs e)
43
43
  {
44
- int Row = this.dataGridView1.Rows.Add();
44
+ 'int Row = this.dataGridView1.Rows.Add();
45
45
  this.dataGridView1.Rows[Row].Cells[1].Value = dateTimePicker1.Value.ToString();
46
- this.dataGridView1.Rows[Row].Cells[2].Value = textBox1.Text;
46
+ this.dataGridView1.Rows[Row].Cells[2].Value = textBox1.Text;'
47
47
 
48
48
  }
49
49
 
@@ -59,12 +59,12 @@
59
59
 
60
60
  private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
61
61
  {
62
- Convert.ToBoolean(dataGridView1.Rows[1].Cells[0].Value);
62
+ 'Convert.ToBoolean(dataGridView1.Rows[1].Cells[0].Value);'
63
63
  }
64
64
 
65
65
  private void 削除_Click(object sender, EventArgs e)
66
66
  {
67
- this.dataGridView1.CurrentCell.Value = DBNull.Value;
67
+ ' this.dataGridView1.CurrentCell.Value = DBNull.Value;'
68
68
 
69
69
  }
70
70