/// <summary> /// 双击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.Rows.Count > 0) { int ColIndex = dataGridView1.CurrentCell.ColumnIndex; if (ColIndex == 11) { SelectMZYSandHushi F1 = new SelectMZYSandHushi(1, txtMZYS); F1.ShowDialog(); dataGridView1.CurrentCell.Value = F1.Strdata; } else if (ColIndex == 12) { SelectMZYSandHushi F1 = new SelectMZYSandHushi(2, txtMZYS); F1.ShowDialog(); dataGridView1.CurrentCell.Value = F1.Strdata; } else if (ColIndex == 13) { SelectMZYSandHushi F1 = new SelectMZYSandHushi(2, txtMZYS); F1.ShowDialog(); dataGridView1.CurrentCell.Value = F1.Strdata; } else if (ColIndex == 15) { Rectangle rect = dataGridView1.GetCellDisplayRectangle(dataGridView1.CurrentCell.ColumnIndex, dataGridView1.CurrentCell.RowIndex, false); cmbSF.Left = rect.Left; cmbSF.Top = rect.Top; cmbSF.Width = rect.Width; cmbSF.Height = rect.Height; cmbSF.Visible = true; cmbSF.Text = ""; } else if (ColIndex == 16) { Rectangle rect = dataGridView1.GetCellDisplayRectangle(dataGridView1.CurrentCell.ColumnIndex, dataGridView1.CurrentCell.RowIndex, false); cmbSF.Left = rect.Left; cmbSF.Top = rect.Top; cmbSF.Width = rect.Width; cmbSF.Height = rect.Height; cmbSF.Visible = true; cmbSF.Text = ""; } else if (ColIndex == 17) { Rectangle rect = dataGridView1.GetCellDisplayRectangle(dataGridView1.CurrentCell.ColumnIndex, dataGridView1.CurrentCell.RowIndex, false); cmbSF.Left = rect.Left; cmbSF.Top = rect.Top; cmbSF.Width = rect.Width; cmbSF.Height = rect.Height; cmbSF.Visible = true; cmbSF.Text = ""; } else { cmbSF.Visible = false; } } }
private void lineXHHS_DoubleClick(object sender, EventArgs e) { SelectMZYSandHushi F1 = new SelectMZYSandHushi(2, lineXHHS); F1.ShowDialog(); }
private void txtOS_DoubleClick(object sender, EventArgs e) { SelectMZYSandHushi F1 = new SelectMZYSandHushi(1, txtOS); F1.ShowDialog(); }