private void timer1_Tick(object sender, EventArgs e) { if (label5.Visible == false) { Int32 index = 0; if (dataGridView3.SelectedRows.Count > 0) { index = dataGridView3.SelectedRows[0].Index;//选中的第一条索引 } if (SeqKind == 1) { timer1.Enabled = false; //刷新需要准备的 DS.GetPadOnInfo(-1);//获取全部 DS.GetPadFinishInfo(-1); DS.GetPadReaderData(-1); dataGridView3.ClearSelection(); dataGridView3.Rows[index].Selected = true; timer1.Enabled = true; } else { timer1.Enabled = false; //刷新需要准备的 DS.GetPadOnInfo(Convert.ToInt32(lid)); DS.GetPadFinishInfo(Convert.ToInt32(lid)); DS.GetPadReaderData(Convert.ToInt32(lid)); dataGridView3.ClearSelection(); dataGridView3.Rows[index].Selected = true; timer1.Enabled = true; } } else { timer1.Enabled = true; } }