Example #1
0
        private void buttonX1_Click(object sender, EventArgs e)
        {
            Consulta_Suplidor doForm = new Consulta_Suplidor();

            if (doForm.ShowDialog() == DialogResult.OK)
            {
                txtsuplidor.Text = doForm.codigo.Text;
                canart.Focus();
                SendKeys.Send("{enter}");
            }
        }
Example #2
0
 private void txtsuplidor_KeyDown(object sender, KeyEventArgs e)
 {
     switch (e.KeyCode)
     {
     case Keys.Enter:
         if (string.IsNullOrEmpty(codart.Text.Trim()))
         {
             Consulta_Suplidor doForm = new Consulta_Suplidor();
             if (doForm.ShowDialog() == DialogResult.OK)
             {
                 txtsuplidor.Text = doForm.codigo.Text;
                 codart.Focus();
                 SendKeys.Send("{enter}");
             }
             break;
         }
         else
         {
             return;
         }
     }
 }