private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                DataGridViewRow dr = dataGridView1.SelectedRows[0];
                this.Hide();
                frmProduct frm = new frmProduct();
                frm.Show();
                frm.txtProductName.Text = dr.Cells[0].Value.ToString();
                frm.textBox1.Text = dr.Cells[0].Value.ToString();
                frm.cmbCategory.Text = dr.Cells[1].Value.ToString();
                frm.cmbCompany.Text = dr.Cells[2].Value.ToString();
                frm.btnUpdate.Enabled = true;
                frm.btnDelete.Enabled = true;
                frm.btnSave.Enabled = false;
                frm.txtProductName.Focus();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 private void frmProductsRecord_FormClosing(object sender, FormClosingEventArgs e)
 {
     this.Hide();
     frmProduct frm = new frmProduct();
     frm.Show();
 }
Beispiel #3
0
 private void productToolStripMenuItem_Click(object sender, EventArgs e)
 {
     frmProduct frm = new frmProduct();
     frm.Show();
 }