private void dgExpenditureRecord_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { try { DataGridViewRow adgvr = dgExpenditureRecord.SelectedRows[0]; this.Hide(); ExpenditureUI aExpenditureUi = new ExpenditureUI(); aExpenditureUi.Show(); aExpenditureUi.txtId.Text = adgvr.Cells[0].Value.ToString(); aExpenditureUi.txtName.Text = adgvr.Cells[1].Value.ToString(); aExpenditureUi.txtRemarks.Text = adgvr.Cells[2].Value.ToString(); aExpenditureUi.txtAmount.Text = adgvr.Cells[3].Value.ToString(); aExpenditureUi.DateTimePlickerDate.Text = adgvr.Cells[4].Value.ToString(); aExpenditureUi.btnDelete.Enabled = true; aExpenditureUi.btnUpdate.Enabled = true; aExpenditureUi.btnSave.Enabled = false; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ExpenditureRecordUI_FormClosing(object sender, FormClosingEventArgs e) { ExpenditureUI a = new ExpenditureUI(); a.Show(); }
private void expenditureToolStripMenuItem_Click_1(object sender, EventArgs e) { ExpenditureUI aex = new ExpenditureUI(); aex.Show(); }