コード例 #1
0
        private void productoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ConsultaProductos frmPro = new ConsultaProductos();

            frmPro.MdiParent = this;
            frmPro.Show();
        }
コード例 #2
0
        private void btnProductos_Click(object sender, EventArgs e)
        {
            ConsultaProductos frmPro = new ConsultaProductos();

            frmPro.ShowDialog();
            if (frmPro.DialogResult == DialogResult.OK)
            {
                // fila seleccionada en el datagridview del formulario ConsultarCliente
                int fila = frmPro.dataGridView1.CurrentRow.Index;
                txtCodArticulo.Text = frmPro.dataGridView1.Rows[fila].Cells[0].Value.ToString();
                txtDescripcion.Text = frmPro.dataGridView1.Rows[fila].Cells[1].Value.ToString();
                txtPrecio.Text      = frmPro.dataGridView1.Rows[fila].Cells[2].Value.ToString();
            }
        }