日期:2014-05-18 浏览次数:20950 次
datagridview1.currentcell=datagridview1.rows[0].cells[0]
private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e) { if (e.TabPageIndex == 1) this.dataGridView1.CurrentCell = this.dataGridView1.Rows[0].Cells[0]; } 或 private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if(this.tabControl1.SelectedIndex==1) this.dataGridView1.CurrentCell = this.dataGridView1.Rows[0].Cells[0]; }