private void btnEdit_Click(object sender, EventArgs e) { int selectedrowindex = dgPassword.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = dgPassword.Rows[selectedrowindex]; string id = selectedRow.Cells[0].Value.ToString(); string username = selectedRow.Cells[1].Value.ToString(); string password = selectedRow.Cells[2].Value.ToString(); string website = selectedRow.Cells[3].Value.ToString(); frmEdit temp = new frmEdit(this, id, username, password, website); temp.Show(); }
private void Addnew() { try { frmEdit frm = new frmEdit(); intChild += 1; frm.MdiParent = this; frm.Text = "Child " + intChild; frm.Show(); } catch (System.Exception exp) { MessageBox.Show(exp.Message, this.Text); } }