private void Btn_consultar_Click(object sender, EventArgs e) { if (presionado == false) { Desahiblitarbtn(); Btn_consultar.Enabled = true; presionado = true; } else { Frm_consultaGuiaT conBonos_Desc = new Frm_consultaGuiaT(); conBonos_Desc.ShowDialog(); if (conBonos_Desc.DialogResult == DialogResult.OK) { Txt_idguia.Text = conBonos_Desc.Dgv_consultaBonoYDesc.Rows[conBonos_Desc.Dgv_consultaBonoYDesc.CurrentRow.Index]. Cells[0].Value.ToString(); Txt_ruta.Text = conBonos_Desc.Dgv_consultaBonoYDesc.Rows[conBonos_Desc.Dgv_consultaBonoYDesc.CurrentRow.Index]. Cells[1].Value.ToString(); Txt_descripcion.Text = conBonos_Desc.Dgv_consultaBonoYDesc.Rows[conBonos_Desc.Dgv_consultaBonoYDesc.CurrentRow.Index]. Cells[2].Value.ToString(); Txt_idguia.Focus(); presionado = false; Habilitarbtn(); } } }
private void Btn_buscarGuia_Click(object sender, EventArgs e) { Frm_consultaGuiaT consultaguia = new Frm_consultaGuiaT(); consultaguia.ShowDialog(); if (consultaguia.DialogResult == DialogResult.OK) { Txt_Guia.Text = consultaguia.Dgv_consultaBonoYDesc.Rows[consultaguia.Dgv_consultaBonoYDesc.CurrentRow.Index]. Cells[1].Value.ToString(); idguia = consultaguia.Dgv_consultaBonoYDesc.Rows[consultaguia.Dgv_consultaBonoYDesc.CurrentRow.Index]. Cells[0].Value.ToString(); } Console.WriteLine(idguia); }