private void ListDataGriddView_CellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } if (e.ColumnIndex == 0) { //单选 //checkbox if ((bool)listDataGriddView.Rows[e.RowIndex].Cells[0].EditedFormattedValue == true) { listDataGriddView.Rows[e.RowIndex].Cells[0].Value = false; } else { listDataGriddView.Rows[e.RowIndex].Cells[0].Value = true; } } string columnName = listDataGriddView.Columns[e.ColumnIndex].Name; //删除 if (columnName == "java_row") { CodeProjectAdd createCode = new CodeProjectAdd(listData[e.RowIndex].ID); DialogUtil.ShowDialog(createCode, this, createCode.Width, createCode.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog)); } else if (columnName == "csharp_row") { AutoCodeConfigForm autoCodeConfigForm = new AutoCodeConfigForm(listData[e.RowIndex]); DialogUtil.ShowDialog(autoCodeConfigForm, this, autoCodeConfigForm.Width, autoCodeConfigForm.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog)); } } catch (Exception ex) { MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnAdd_Click_2(object sender, EventArgs e) { CodeProjectAdd createCode = new CodeProjectAdd(); DialogUtil.ShowDialog(createCode, this, createCode.Width, createCode.Height, new Common.prop.FormWindowProp(false, false, FormBorderStyle.FixedDialog)); }