鼠标点击单元格显示在相应文本框中的方法(单元格事件)

 1 //点击单元格显示此行相应内容
 2   private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 3         {
 4 //  找到鼠标点击的行
 5             int index = e.RowIndex;
 6             DataGridViewRow currenRow = this.dataGridView1.Rows[index];
 7 //找到每一个单元格的值
 8             this.textBox2.Text= currenRow.Cells[0].Value.ToString();
 9             this.textBox4.Text = currenRow.Cells[1].Value.ToString();
10             this.textBox5.Text = currenRow.Cells[2].Value.ToString();
11             this.textBox3.Text = currenRow.Cells[3].Value.ToString();
12             this.textBox6.Text = currenRow.Cells[4].Value.ToString();
13 
14         }

    许久没来整理,一直都在弄FL,没关系,学到心里,装到心里就行!

最重要的是在这个青春岁月里,能做自己喜欢开心的事,是多么难得可贵的,现在算来,也就一年了,好好珍惜这放荡不羁的自己,时间不多了,自己快乐就行。

人这一生,快乐的阶段又能占多少呢!或许已拎不起~~~~~

                                     -------来自凌波小屋----冯和超的4/22笔记------

原文地址:https://www.cnblogs.com/lingbohome/p/4527777.html