以下代碼:
私人?作廢?datagridview 1 _ cell click(object?發件人?DataGridViewCellEventArgs?e)
{
如果?(this.dataGridView1。選擇行?!=?null?& amp& amp?this.dataGridView1。選擇行。計數?& gt?0)
{
this . txt name . text = this . datagridview 1。選擇行[0]。cells[1]. value . tostring();
//其他文本框等等,只是改變單元格的索引值。
}
}