private void button4_Click(object sender, EventArgs e)
 {
     if (dataGridView1.RowCount > 0)
     {
         var forma = new frm_detalleCompra(dataGridView1.CurrentRow.Cells[0].Value.ToString(), null, null, null, false);
         forma.ShowDialog();
     }
 }
        private void my_menu_Itemclicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (flag == false)
            {
                if (e.ClickedItem.Name == "ColHidden")
                {
                    dataGridView1.Rows[this.dataGridView1.CurrentRow.Index].Visible = false;
                    flag = true;
                }
                else if (e.ClickedItem.Name == "ColEdit")
                {
                    mymenu.Visible = false;
                    if (dataGridView1.RowCount > 0)
                    {
                        eliminaCompra();
                    }
                    flag = true;
                }
                else if (e.ClickedItem.Name == "ColDelete")
                {
                    mymenu.Visible = false;
                    mymenu.Enabled = false;
                    flag           = true;
                    button2.PerformClick();
                }
                else if (e.ClickedItem.Name == "ColAs")
                {
                    mymenu.Visible = false;
                    mymenu.Enabled = false;

                    flag = true;
                    if (dataGridView1.RowCount > 0)
                    {
                        var forma = new frm_detalleCompra(dataGridView1.CurrentRow.Cells[0].Value.ToString(), null, null, null, false);
                        forma.ShowDialog();
                    }
                }
            }
        }