private void btnVisualizarPedido_Click(object sender, EventArgs e) { if (ped_id != 0) { Visualizar_Pedido cad = new Visualizar_Pedido(ped_id); panel1.Visible = true; cad.TopLevel = false; if (panel1.Controls.Count != 0) { panel1.Controls.RemoveAt(0); } panel1.Controls.Add(cad); cad.FormBorderStyle = FormBorderStyle.None; cad.Show(); } }
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int index = e.RowIndex; if (e.RowIndex == -1) { return; } DataGridViewRow selectedRow = dataGridView1.Rows[index]; ped_id = Convert.ToInt32(selectedRow.Cells[0].Value); Visualizar_Pedido cad = new Visualizar_Pedido(ped_id); panel1.Visible = true; cad.TopLevel = false; if (panel1.Controls.Count != 0) { panel1.Controls.RemoveAt(0); } panel1.Controls.Add(cad); cad.FormBorderStyle = FormBorderStyle.None; cad.Show(); }