Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
単一の列のすべての値を追加 (合計) し、1 つのテキスト ボックスに表示したい
Leaveこれには のイベントを使用できますDataGridView。
Leave
DataGridView
private void dataGridView1_Leave(object sender, EventArgs e) { int sum = 0; foreach (DataGridViewRow row in dataGridView1.Rows) { sum += Convert.ToInt32(row.Cells[0].Value); } textBox1.Text = sum.ToString(); }