private void btnAdd_Click(object sender, EventArgs e)
        {
            StockManagement addStock = new StockManagement();

            addStock.FormClosing += new FormClosingEventHandler(this.StockManagement_FormClosing);
            addStock.Show();
        }
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0 && !dataGridView1.SelectedRows[0].IsNewRow)
     {
         DataGridViewSelectedRowCollection selectedRow = dataGridView1.SelectedRows;
         StockManagement editStock = new StockManagement(selectedRow);
         editStock.FormClosing += new FormClosingEventHandler(this.StockManagement_FormClosing);
         editStock.Show();
     }
 }