private void Button1_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Se cerrará esta ventana, desea continuar? ", "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
     {
         ConsultarProductos consulta = new ConsultarProductos();
         this.Hide();
         consulta.Show();
     }
 }
        private void ProductoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ConsultarProductos ConPro = new ConsultarProductos
            {
                MdiParent = this
            };

            ConPro.Show();
        }
示例#3
0
        private void BtnProductos_Click(object sender, EventArgs e)
        {
            ConsultarProductos ConPro = new ConsultarProductos();

            ConPro.ShowDialog();

            if (ConPro.DialogResult == DialogResult.OK)
            {
                txtCodigoProducto.Text = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[0].Value.ToString();
                txtDescripcion.Text    = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[2].Value.ToString() + " " + ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[3].Value.ToString() + " " + ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[4].Value.ToString() + "GB";
                txtPrecioUnidad.Text   = ConPro.dataGridView1.Rows[ConPro.dataGridView1.CurrentRow.Index].Cells[6].Value.ToString();
                txtcantidad.Focus();
            }
        }