private void frmScholarshipPaymentRecord_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frmScholarshipPayment frm = new frmScholarshipPayment();

            frm.label5.Text = label10.Text;
            frm.label6.Text = label11.Text;
            frm.Show();
        }
        private void scholarshipPaymentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmScholarshipPayment frm = new frmScholarshipPayment();

            frm.label5.Text = UserType.Text;
            frm.label6.Text = User.Text;
            frm.Show();
        }
 private void dataGridView4_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     try
     {
         DataGridViewRow dr = dataGridView4.SelectedRows[0];
         this.Hide();
         frmScholarshipPayment frm = new frmScholarshipPayment();
         // or simply use column name instead of index
         //dr.Cells["id"].Value.ToString();
         frm.Show();
         frm.ScholarshipPaymentID.Text = dr.Cells[0].Value.ToString();
         frm.ScholarshipID.Text        = dr.Cells[1].Value.ToString();
         frm.ScholarshipName.Text      = dr.Cells[2].Value.ToString();
         frm.Amount.Text             = dr.Cells[3].Value.ToString();
         frm.ScholarNo.Text          = dr.Cells[4].Value.ToString();
         frm.StudentName.Text        = dr.Cells[5].Value.ToString();
         frm.Course.Text             = dr.Cells[6].Value.ToString();
         frm.Branch.Text             = dr.Cells[7].Value.ToString();
         frm.PaymentDate.Text        = dr.Cells[8].Value.ToString();
         frm.ModeOfPayment.Text      = dr.Cells[9].Value.ToString();
         frm.PaymentModeDetails.Text = dr.Cells[10].Value.ToString();
         frm.TotalPaid.Text          = dr.Cells[11].Value.ToString();
         frm.DuePayment.Text         = dr.Cells[12].Value.ToString();
         if (label10.Text == "Admin")
         {
             frm.Delete.Enabled        = true;
             frm.Update_record.Enabled = true;
             frm.btnSave.Enabled       = false;
             frm.Print.Enabled         = true;
             frm.label5.Text           = label10.Text;
             frm.label6.Text           = label11.Text;
         }
         else
         {
             frm.Delete.Enabled        = false;
             frm.Update_record.Enabled = false;
             frm.btnSave.Enabled       = false;
             frm.Print.Enabled         = true;
             frm.label5.Text           = label10.Text;
             frm.label6.Text           = label11.Text;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }